valid([ "email" => "required|email", "source" => "required", ]); return $this->ok(app(EmailService::class)->emailCaptcha($params['email'], $params['source'])); } public function profile() { /** @var User $user */ $user = Auth::user(); return $this->ok([ "id" => $user->id, "token" => app(AuthService::class)->encryptToken($user->id), "name" => $user->name, "avatar" => $user->avatar, "company" => [ "id" => optional($user->company)->id ?? 0, "name" => optional($user->company)->name ?? "", ], ]); } public function register() { return $this->ok([ "token" => "token", "name" => "", "phone" => "", ]); } public function login() { return $this->ok([ "token" => "token", "name" => "", "phone" => "", ]); } public function resetPassword() { return $this->ok([ "token" => "token", "name" => "", "phone" => "", ]); } }