Answers for "laravel form request validation unique update"

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
0

laravel form request validation unique update

public function rules()
{
  return [
      'email' => 'required|email|unique:users,email,'.$this->user->id,
  ];
}
Posted by: Guest on September-25-2021

Code answers related to "laravel form request validation unique update"

Browse Popular Code Answers by Language