. */ declare(strict_types=1); namespace FireflyIII\Http\Requests; /** * @codeCoverageIgnore * Class ConfigurationRequest. */ class ConfigurationRequest extends Request { /** * @return bool */ public function authorize() { // Only allow logged in users and admins return auth()->check() && auth()->user()->hasRole('owner'); } /** * @return array */ public function getConfigurationData(): array { return [ 'single_user_mode' => $this->boolean('single_user_mode'), 'is_demo_site' => $this->boolean('is_demo_site'), ]; } /** * @return array */ public function rules() { // fixed $rules = [ 'single_user_mode' => 'between:0,1|numeric', 'is_demo_site' => 'between:0,1|numeric', ]; return $rules; } }