Commit 4f6cdddf authored by Nicolas Widart's avatar Nicolas Widart

Add create menu validation

parent 11151733
......@@ -6,7 +6,10 @@ class CreateMenuRequest extends FormRequest
{
public function rules()
{
return [];
return [
'name' => 'required',
'primary' => 'unique:menus',
];
}
public function authorize()
......@@ -16,6 +19,9 @@ class CreateMenuRequest extends FormRequest
public function messages()
{
return [];
return [
'name.required' => trans('menu::validation.name is required'),
'primary.unique' => trans('menu::validation.only one primary menu'),
];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment