user(); return $user and $user->can('update', $this->delivery_mode); } /** * Prepare the data for validation. * * @return void */ protected function prepareForValidation() { $this->merge([ 'status' => $this->status ? true : false, 'is_free' => $this->is_free ? true : false ]); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'status' => 'required|boolean', 'is_free' => 'required|boolean' ]; } }