. */ declare(strict_types=1); namespace FireflyIII\Http\Requests; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; /** * Class UserFormRequest. * * @codeCoverageIgnore */ class UserFormRequest extends FormRequest { use ConvertsDataTypes; use ChecksLogin; /** * Get data for controller. * * @return array */ public function getUserData(): array { return [ 'email' => $this->convertString('email'), 'blocked' => 1 === $this->convertInteger('blocked'), 'blocked_code' => $this->convertString('blocked_code'), 'password' => $this->convertString('password'), 'is_owner' => 1 === $this->convertInteger('is_owner'), ]; } /** * Rules for this request. * * @return array */ public function rules(): array { return [ 'id' => 'required|exists:users,id', 'email' => 'email|required', 'password' => 'confirmed|secure_password', 'blocked_code' => 'between:0,30|nullable', 'blocked' => 'between:0,1|numeric', 'is_owner' => 'between:0,1|numeric', ]; } }