/home/techb158/ileadtechnology.com/SSM/app/Http/Requests/configuration/misc
Edit: /home/techb158/ileadtechnology.com/SSM/app/Http/Requests/configuration/misc/CategoryRequest.php (1185B)
route('id');
$rules = [];
if ($this->method() === 'POST') {
$rules['name'] = 'required|unique:categories';
} elseif ($this->method() === 'PATCH') {
$rules['name'] = 'required|unique:categories,name,'.$id.',id';
}
return $rules;
}
/**
* Translate fields with user friendly name.
*
* @return array
*/
public function attributes()
{
return [
'name' => trans('misc.category_name')
];
}
/**
* Get the error messages for the defined validation rules.
*
* @return array
*/
public function messages()
{
return [
];
}
}