can(Permissions::USER_BANS->value); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'method' => [Rule::enum(HttpMethod::class), 'required'], 'reason' => 'string|required', 'startDate' => 'date|required', 'endDate' => 'date|required', ]; } public function passedValidation() { $fromTimezone = 'Europe/Berlin'; $this->reason = $this->input('reason'); $this->startDate = Carbon::parse($this->input('startDate'), $fromTimezone); $this->endDate = Carbon::parse($this->input('endDate'), $fromTimezone); $this->editMethod = HttpMethod::from($this->input('method')); } }