validate exits in laravel rule code example
Example 1: laravel exists validation
'state_id' => 'exists:states,id'
Example 2: validation rule if row exist laravel
//update request
return [
'username' => 'unique:users,username,' . $this->route('internalUser')->id . ',id',
];
//create request
return [
'username' => 'unique:users'
];