fix(Api): removed recursive calls from Api and User

This commit is contained in:
Uther
2024-08-21 11:21:25 +02:00
parent a46fcb28b0
commit 308d1a2eb7
2 changed files with 17 additions and 17 deletions

View File

@@ -21,16 +21,5 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(): void
{
$this->app->bind(ThemeParkUser::class, function () {
$api = app(PhantasialandApi::class);
if(ThemeParkUser::query()->count() === 0) {
$userData = $api->createUser();
return ThemeParkUser::query()->create([
'username' => $userData['email'],
'password' => $userData['password'],
]);
}
return ThemeParkUser::query()->first();
});
}
}