mission->state_id == MissionStates::PENDING_CONFIRMATION->value; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ 'code' => 'required|string', 'km' => 'required', ]; } public function after(): array { return [ function (Validator $validator) { if ($this->mission->code != $this->code) { $validator->errors()->add( 'code', 'کد وارد شده صحیح نمی باشد' ); } }, ]; } }