isMethod('put') || $this->isMethod('patch')) && !$this->has('flag_send')) { $this->merge([ 'flag_send' => config('constants.FLAG_SEND_DISABLED'), ]); } } /** * Get the validation rules that apply to the request. */ public function rules(): array { return [ 'card' => 'nullable|integer|min:0', 'num_card' => 'nullable|integer|min:1', 'role' => 'nullable|in:' . config('constants.ROLE_MEMBER') . ',' . config('constants.ROLE_ADMIN'), 'status' => 'nullable|in:' . config('constants.STATUS_INACTIVE') . ',' . config('constants.STATUS_ACTIVE'), 'flag_send' => 'nullable|in:0,1', 'first_login' => 'nullable|in:' . config('constants.FIRST_LOGIN_FALSE') . ',' . config('constants.FIRST_LOGIN_TRUE'), ]; } }