merge([ 'slug' => Str::slug($this->label), 'published' => $this->published ? true : false ]); return auth()->check(); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'label' => 'required|string|max:255', 'slug' => 'required|unique:sliders', 'commentaire' => 'sometimes|max:255', 'published' => 'required|boolean', ]; } /** * Get custom messages for validator errors. * * @return array */ public function messages() { return []; } /** * Get custom attributes for validator errors. * * @return array */ public function attributes() { return [ 'slug' => trans('label') ]; } }