Skip to content

Commit

Permalink
Add optimize in maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurpar06 committed Jul 6, 2024
1 parent e27ed10 commit 0eb4174
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/Filament/Pages/Maintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function clearCaches(): Action
$calls[] = 'cache:clear';
$calls[] = 'route:cache';
$calls[] = 'clear-compiled';
$calls[] = 'filament:clear-cached-components';

$files = File::glob($module_cache_files);
foreach ($files as $file) {
Expand Down Expand Up @@ -152,4 +153,24 @@ public function reseed(): Action
->send();
});
}

public function optimizeApp(): Action
{
return Action::make('optimizeApp')->icon('heroicon-o-wrench-screwdriver')->label('Optimize App')->action(function () {
$calls = [
//'icons:cache',
'filament:cache-components',
'optimize'
];

foreach ($calls as $call) {
Artisan::call($call);
}

Notification::make()
->title('Application optimized!')
->success()
->send();
});
}
}
1 change: 1 addition & 0 deletions resources/views/filament/pages/maintenance.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{{ $this->forceUpdateCheckAction() }}
{{ $this->reseed() }}
{{ $this->flushQueue() }}
{{ $this->optimizeApp() }}
</x-filament::section>

<x-filament::section>
Expand Down

0 comments on commit 0eb4174

Please sign in to comment.