merge([ 'subscribe' => $this->subscribe ? true : false ]); return auth()->check() and (auth()->user()->role->equals(Role::admin()) or $this->ticket->project->id === auth()->user()->project_id); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'subscribe' => 'required|boolean', 'message' => 'required|min:' . (auth()->user()->role->equals(Role::admin()) ? '5' : '20'), 'file_message' => 'sometimes|mimes:jpeg,jpg,png,pdf|max:2048' ]; } }