Fix notifications asset caching
This commit is contained in:
@@ -6,7 +6,10 @@ use App\Models\Domain;
|
|||||||
use App\Observers\DomainObserver;
|
use App\Observers\DomainObserver;
|
||||||
use App\Support\Notifications\Notification as LivewireNotification;
|
use App\Support\Notifications\Notification as LivewireNotification;
|
||||||
use Filament\Notifications\Notification;
|
use Filament\Notifications\Notification;
|
||||||
|
use Filament\Support\Assets\Js;
|
||||||
|
use Filament\Support\Facades\FilamentAsset;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Illuminate\Support\Facades\File;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@@ -25,6 +28,14 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
{
|
{
|
||||||
Domain::observe(DomainObserver::class);
|
Domain::observe(DomainObserver::class);
|
||||||
|
|
||||||
|
$versionFile = base_path('VERSION');
|
||||||
|
$appVersion = File::exists($versionFile) ? trim(File::get($versionFile)) : null;
|
||||||
|
FilamentAsset::appVersion($appVersion ?: null);
|
||||||
|
|
||||||
|
FilamentAsset::register([
|
||||||
|
Js::make('notifications', public_path('js/app/notifications.js')),
|
||||||
|
], 'app');
|
||||||
|
|
||||||
// Note: AuthEventListener is auto-discovered by Laravel 11+
|
// Note: AuthEventListener is auto-discovered by Laravel 11+
|
||||||
// Do not manually subscribe - it causes duplicate audit log entries
|
// Do not manually subscribe - it causes duplicate audit log entries
|
||||||
}
|
}
|
||||||
|
|||||||
1
public/js/app/notifications.js
Normal file
1
public/js/app/notifications.js
Normal file
File diff suppressed because one or more lines are too long
27
resources/views/vendor/filament/assets.blade.php
vendored
Normal file
27
resources/views/vendor/filament/assets.blade.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
@if (isset($data))
|
||||||
|
<script>
|
||||||
|
window.filamentData = @js($data)
|
||||||
|
</script>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@foreach ($assets as $asset)
|
||||||
|
@if (! $asset->isLoadedOnRequest())
|
||||||
|
@php
|
||||||
|
$skipNotificationScript = $asset instanceof \Filament\Support\Assets\Js
|
||||||
|
&& $asset->getPackage() === 'filament/notifications'
|
||||||
|
&& $asset->getId() === 'notifications';
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@if (! $skipNotificationScript)
|
||||||
|
{{ $asset->getHtml() }}
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
@foreach ($cssVariables ?? [] as $cssVariableName => $cssVariableValue) --{{ $cssVariableName }}:{{ $cssVariableValue }}; @endforeach
|
||||||
|
}
|
||||||
|
|
||||||
|
@foreach ($customColors ?? [] as $customColorName => $customColorShades) .fi-color-{{ $customColorName }} { @foreach ($customColorShades as $customColorShade) --color-{{ $customColorShade }}:var(--{{ $customColorName }}-{{ $customColorShade }}); @endforeach } @endforeach
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user