HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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;

    }

}