File: D:/HostingSpaces/SBogers33/bbec.nl/workbench/komma/kms/src/Komma/Kms/Core/Validators/Validator.php
<?php namespace Komma\Kms\Core\Validators;
/**
* Short description for the file.
*
* @author Komma <info@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
class Validator
{
public function validate($attribute, $value, $parameters)
{
return $value = "csv";
}
public function requiredIfNotEmpty($attribute, $value, $parameters)
{
//$parameters[0] is the field we are going to check if it is not empty
$fieldToCheck = $parameters[0];
//FieldToCheck does not exist, current field is not required
if(!\Input::has($fieldToCheck)) return true;
//FieldToCheck is empty , current field is not required
if(empty(\Input::get($fieldToCheck))) return true;
//If the value is empty, trow error
if(empty($value) ||$value == '[]') return false;
return true;
}
}