45 lines
821 B
PHP
45 lines
821 B
PHP
<?php
|
|
|
|
namespace App\Rules\PaymentRules;
|
|
|
|
use Illuminate\Contracts\Validation\Rule;
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
class PilihMinimumSatuSAG implements Rule
|
|
{
|
|
/**
|
|
* Create a new rule instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Determine if the validation rule passes.
|
|
*
|
|
* @param string $attribute
|
|
* @param mixed $value
|
|
* @return bool
|
|
*/
|
|
public function passes($attribute, $value)
|
|
{
|
|
$norujukanToPay = json_decode($value);
|
|
|
|
return sizeof($norujukanToPay) > 0;
|
|
|
|
}
|
|
|
|
/**
|
|
* Get the validation error message.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function message()
|
|
{
|
|
return 'Sila pilih salah satu checkbox di atas terlebih dahulu!';
|
|
}
|
|
}
|