user()->isAdmin(); } public function rules(): array { return [ 'paused' => 'sometimes|bool', 'repeat_every' => 'sometimes|string|in:DAY,WEEK,MONTH,3MONTHS,YEAR', 'start_from' => 'sometimes', 'scheduled_run'=>'sometimes' ]; } public function prepareForValidation() { $request = $this->all(); if (isset($request['start_from'])) { $request['scheduled_run'] = Carbon::parse((int)$request['start_from']); $request['start_from'] = Carbon::parse((int)$request['start_from']); } $this->replace($request); } }