harim->province_id == auth()->user()->province_id && $this->harim->state_id == HarimStates::BARESI_ARSE_VA_AYAN_ERSAL_SHODE_TAVASOT_DAFTAR_HARIM->value; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ 'traffic' => 'required|numeric|decimal:0,1', 'road_type' => 'required|numeric|decimal:0,1', 'position' => 'required|numeric|decimal:0,1', 'final_area_space' => 'required|numeric|decimal:0,2', //عرصه 'final_plan_space' => 'required|numeric|decimal:0,2', // عیان 'payment_amount' => 'required|numeric', 'expert_description' => 'required|string', ]; } public function after(): array { return [ function () { $fee = config('harim_web_services.Harim_Payment.fee'); $arse = ( $this->traffic * $this->road_type * $this->position * $fee * $this->final_area_space ); $ayan =( $this->traffic * $this->road_type * $this->position * $fee * $this->final_plan_space ); $result = floor($arse + $ayan); if ($result != $this->payment_amount) { $this->validator->errors()->add( 'payment_amount', 'payment_amount مقادیر بدست امده صحیح نمی باشد.' ); } } ]; } }