diff --git a/src/NamiServiceProvider.php b/src/NamiServiceProvider.php index cbb1aa8..30626cc 100644 --- a/src/NamiServiceProvider.php +++ b/src/NamiServiceProvider.php @@ -16,7 +16,7 @@ class NamiServiceProvider extends ServiceProvider } public function register() { - $this->app->bind('nami.api', function() { + $this->app->singleton('nami.api', function() { return new Api(); }); } diff --git a/src/NamiUser.php b/src/NamiUser.php index 7e955bb..faf08c3 100644 --- a/src/NamiUser.php +++ b/src/NamiUser.php @@ -28,7 +28,7 @@ class NamiUser implements Authenticatable { } public function attemptNamiLogin($password) { - return app(Api::class)->setUser($this)->login($this->mglnr, $password, $this->groupid); + return Nami::setUser($this)->login($this->mglnr, $password, $this->groupid); } public function getNamiGroupId() {