. */ declare(strict_types=1); namespace FireflyIII\Http\Requests; /** * Class UserFormRequest. */ class UserFormRequest extends Request { /** * @return bool */ public function authorize() { // Only allow logged in users return auth()->check(); } /** * @return array */ public function getUserData(): array { return [ 'email' => $this->string('email'), 'blocked' => 1 === $this->integer('blocked'), 'blocked_code' => $this->string('blocked_code'), 'password' => $this->string('password'), ]; } /** * @return array */ public function rules() { return [ 'id' => 'required|exists:users,id', 'email' => 'email|required', 'password' => 'confirmed|secure_password', 'blocked_code' => 'between:0,30|nullable', 'blocked' => 'between:0,1|numeric', ]; } }