Answers for "laravel valid request"

PHP
3

email validation in laravel

'email' => 'required|email|unique:users,email',
//@sujay
Posted by: Guest on October-09-2020
2

custom rule laravel validation

public function store()
{
    $this->validate(request(), [
        'song' => [function ($attribute, $value, $fail) {
            if ($value <= 10) {
                $fail(':attribute needs more cowbell!');
            }
        }]
    ]);
}
Posted by: Guest on October-06-2020

Browse Popular Code Answers by Language