Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

custom rule laravel validation

public function store()
{
    $this->validate(request(), [
        'song' => [function ($attribute, $value, $fail) {
            if ($value <= 10) {
                $fail(':attribute needs more cowbell!');
            }
        }]
    ]);
}
Source by laravel-news.com #
 
PREVIOUS NEXT
Tagged: #custom #rule #laravel #validation
ADD COMMENT
Topic
Name
7+4 =