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
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\Http\Middleware;
use App\Models\Miscellaneous\WebsiteSetting;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class InjectPwaMeta
{
public function handle(Request $request, Closure $next): Response
{
$pwaEnabled = WebsiteSetting::where('key', 'pwa_enabled')->first()?->value === '1';
if ($pwaEnabled) {
$config = [
'name' => WebsiteSetting::where('key', 'pwa_name')->first()?->value ?? 'Epicnabbo',
'short_name' => WebsiteSetting::where('key', 'pwa_short_name')->first()?->value ?? 'Epicnabbo',
'theme_color' => WebsiteSetting::where('key', 'pwa_theme_color')->first()?->value ?? '#eeb425',
];
view()->share('pwa_enabled', true);
view()->share('pwa_config', $config);
} else {
view()->share('pwa_enabled', false);
}
return $next($request);
}
}