can(Permissions::EDIT_USERS->value); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'currencyA' => 'int|required', 'currencyB' => 'int|required', 'currencyC' => 'int|required', 'lastFaction' => ['required', Rule::enum(Faction::class)], 'lastRunner' => ['required', Rule::enum(Runner::class)], 'lastHunter' => ['required', Rule::enum(Hunter::class)], 'runnerFactionLevel' => 'int|min:1', 'SmokeLevel' => 'int|min:1', 'InkLevel' => 'int|min:1', 'GhostLevel' => 'int|min:1', 'SawbonesLevel' => 'int|min:1', 'SwitchLevel' => 'int|min:1', 'DashLevel' => 'int|min:1', 'hunterFactionLevel' => 'int|min:1', 'StalkerFactionLevel' => 'int|min:1', 'PoacherFactionLevel' => 'int|min:1', 'InquisitorFactionLevel' => 'int|min:1', 'MassLevel' => 'int|min:1', ]; } public function passedValidation() { $this->currencyA = $this->input('currencyA'); $this->currencyB = $this->input('currencyB'); $this->currencyC = $this->input('currencyC'); $this->lastFaction = Faction::tryFrom($this->input('lastFaction')); $this->lastRunner = Runner::tryFrom($this->input('lastRunner')); $this->lastHunter = Hunter::tryFrom($this->input('lastHunter')); $this->hasPlayedDG1 = $this->input('hasPlayedDG1', false); $this->runnerFactionLevel = $this->input('runnerFactionLevel'); foreach(Runner::cases() as $runner) { $this->{'level'.$runner->value} = $this->input($runner->value.'Level'); } $this->hunterFactionLevel = $this->input('hunterFactionLevel'); foreach (Hunter::cases() as $hunter) { $this->{'level'.$hunter->value} = $this->input($hunter->value.'Level'); } } }