Answers for "define a column as unique in laravel validation"

PHP
1

set unique value validation for laravel form request

use Illuminate\Validation\Rule;

public function rules()
{
    return [
	    'title' => [
		    'required',
		    Rule::unique('posts', 'title')->ignore($this->post)
	    ]
    ]; 
}
Posted by: Guest on January-03-2021
1

laravel unique validation on multiple columns

'mobile_no' 
  => 'unique:users,mobile_no,NULL,id,country_id,'.request('country_id');
Posted by: Guest on October-23-2020

Code answers related to "define a column as unique in laravel validation"

Browse Popular Code Answers by Language