custom rule laravel validation

PHP
unique:users,username,id,1 // table, field, idcolumn, value to ignorepublic function store()
{
    $this->validate(request(), [
        'song' => [function ($attribute, $value, $fail) {
            if ($value <= 10) {
                $fail(':attribute needs more cowbell!');
            }
        }]
    ]);
}

Source

Also in PHP: