Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

set unique value validation for laravel form request

use IlluminateValidationRule;

public function rules()
{
    return [
	    'title' => [
		    'required',
		    Rule::unique('posts', 'title')->ignore($this->post)
	    ]
    ]; 
}
Source by www.csrhymes.com #
 
PREVIOUS NEXT
Tagged: #set #unique #validation #laravel #form #request
ADD COMMENT
Topic
Name
2+4 =