custom rule laravel validation

custom rule laravel validation
public function store()
{
$this->validate(request(), [
'song' => [function ($attribute, $value, $fail) {
if ($value <= 10) {
$fail(':attribute needs more cowbell!');
}
}]
]);
}
validate field for existing client laravel
unique:users,username,id,1 // table, field, idcolumn, value to ignore

Leave a Comment