. */ declare(strict_types=1); namespace FireflyIII\Http\Requests; /** * Class UserFormRequest. * * @codeCoverageIgnore */ class UserFormRequest extends Request { /** * Verify the request. * * @return bool */ public function authorize(): bool { // Only allow logged in users return auth()->check(); } /** * Get data for controller. * * @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'), ]; } /** * 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', ]; } }