You've already forked Atomcms-edit
42 lines
1.1 KiB
PHP
Executable File
42 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\Miscellaneous\WebsiteSetting;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class PwaServiceProvider extends ServiceProvider
|
|
{
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
public function boot(): void
|
|
{
|
|
// PWA manifest and service worker are served from public/
|
|
// This provider can be extended for push notifications
|
|
}
|
|
|
|
public static function isEnabled(): bool
|
|
{
|
|
$setting = WebsiteSetting::where('key', 'pwa_enabled')->first();
|
|
|
|
return $setting?->value === '1';
|
|
}
|
|
|
|
public static function getConfig(): array
|
|
{
|
|
$enabled = self::isEnabled();
|
|
|
|
return [
|
|
'enabled' => $enabled,
|
|
'name' => setting('pwa_name', 'Epicnabbo Hotel'),
|
|
'short_name' => setting('pwa_short_name', 'Epicnabbo'),
|
|
'description' => setting('pwa_description', 'Welcome to Epicnabbo - Your Habbo Hotel'),
|
|
'theme_color' => setting('pwa_theme_color', '#eeb425'),
|
|
'background_color' => setting('pwa_background_color', '#1a1a2e'),
|
|
];
|
|
}
|
|
}
|