[Question] Filament Page Changes Don’t Take Effect Until Server Restart (Both Locally and on EC2)
Hi, I’m working with Laravel 11+ Filament v3.3.x, and I noticed a strange issue when modifying custom Filament pages (e.g., changing navigation labels or static properties).
---
🔍 Behavior:
When I update this in my App\Filament\Pages\Dashboard class:
protected static ?string $navigationLabel = 'Analytics';
The label does not update immediately, even after running:
php artisan config:clear
php artisan view:clear
php artisan route:clear
php artisan optimize:clear
On local, the change only appears after restarting the dev server:
php artisan serve ← must be restarted to see changes
On EC2 (PHP 8.3-FPM), the changes don’t appear at all unless I:
sudo systemctl restart php8.3-fpm
Even though I confirmed:
The updated class is being used
Git changes were pulled correctly
No caching plugins or CDN layers are interfering
---
❓ My questions:
1. Is this expected behavior in Laravel or Filament — where static properties are cached in memory?
2. Does Filament cache things internally outside of Laravel’s normal cache system?
3. What’s the best practice for developing with Filament when working with custom dashboard pages or widgets that use static properties?
4. Should I disable OPcache in staging environments to avoid this issue?
3 Replies
I have exactly one implementation with Filament v3 and Laravel 11 with pages that works correctly without problems. I just run
php artisan optimize && php artisan filament:cache-components
But I understand that if you use opcache you should always reset its cache or update it.
OPCache must be refreshed.
you can use PHP's
op_flush()
or this library to recompile it with commands:
https://github.com/appstract/laravel-opcacheGitHub
GitHub - appstract/laravel-opcache: Laravel Package for OPcache
Laravel Package for OPcache. Contribute to appstract/laravel-opcache development by creating an account on GitHub.
php artisan opcache:clear
should be enough