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