You've already forked Atomcms-edit
Initial commit
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Atom\CmsSettings\Pages;
|
||||
|
||||
use App\Filament\Resources\Atom\CmsSettings\CmsSettingResource;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Pages\ManageRecords;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class ManageCmsSettings extends ManageRecords
|
||||
{
|
||||
#[\Override]
|
||||
protected static string $resource = CmsSettingResource::class;
|
||||
|
||||
#[\Override]
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('reload_cache')
|
||||
->label('Reload Cache')
|
||||
->icon('heroicon-o-arrow-path')
|
||||
->color('warning')
|
||||
->requiresConfirmation()
|
||||
->modalHeading('Reload Settings Cache')
|
||||
->modalDescription('This will clear and reload the website settings cache. The cache will be automatically rebuilt on the next request.')
|
||||
->modalSubmitActionLabel('Reload Cache')
|
||||
->action(function () {
|
||||
Cache::forget('website_settings');
|
||||
|
||||
Notification::make()
|
||||
->success()
|
||||
->title('Cache Cleared')
|
||||
->body('Settings cache has been cleared successfully.')
|
||||
->send();
|
||||
}),
|
||||
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getTableRecordsPerPageSelectOptions(): array
|
||||
{
|
||||
return [25, 50, 100];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user