first commit

This commit is contained in:
Uther
2024-08-20 21:08:23 +02:00
commit a46fcb28b0
80 changed files with 13840 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Providers;
use App\Http\Services\PhantasialandApi;
use App\Models\ThemeParkUser;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
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();
});
}
}