Initial commit

This commit is contained in:
root
2026-05-09 17:28:23 +02:00
commit 9d73f82529
5575 changed files with 281989 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
<?php
namespace App\Providers;
use App\Models\WebsiteDrawBadge;
use App\Observers\WebsiteDrawBadgeObserver;
use App\Services\InstallationService;
use App\Services\PermissionsService;
use App\Services\RconService;
use App\Services\SettingsService;
use App\Services\ViteService;
use Filament\Tables\Table;
use Illuminate\Foundation\Vite;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
#[\Override]
public function register(): void
{
$this->app->bind(
Vite::class,
ViteService::class,
);
$this->app->singleton(
InstallationService::class,
fn () => new InstallationService,
);
$this->app->singleton(
SettingsService::class,
fn ($app) => new SettingsService($app->make(InstallationService::class)),
);
$this->app->singleton(
PermissionsService::class,
fn () => new PermissionsService,
);
$this->app->singleton(
RconService::class,
fn () => new RconService,
);
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Table::configureUsing(function (Table $table) {
$table->paginated([10, 25, 50]);
});
$settingsService = app(SettingsService::class);
$badgePath = $settingsService->getOrDefault('badge_path_filesystem', '/var/www/gamedata/c_images/album1584');
Config::set('filesystems.disks.badges.root', $badgePath);
$adsPath = $settingsService->getOrDefault('ads_path_filesystem', '/var/www/gamedata/custom');
Config::set('filesystems.disks.ads.root', $adsPath);
WebsiteDrawBadge::observe(WebsiteDrawBadgeObserver::class);
}
}