35 lines
919 B
PHP
35 lines
919 B
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\BackupSetResource\Pages;
|
|
|
|
use App\Filament\Resources\BackupSetResource;
|
|
use App\Support\Auth\Capabilities;
|
|
use App\Support\Auth\UiEnforcement;
|
|
use Filament\Actions;
|
|
use Filament\Resources\Pages\ListRecords;
|
|
|
|
class ListBackupSets extends ListRecords
|
|
{
|
|
protected static string $resource = BackupSetResource::class;
|
|
|
|
private function tableHasRecords(): bool
|
|
{
|
|
return $this->getTableRecords()->count() > 0;
|
|
}
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
UiEnforcement::for(Capabilities::TENANT_SYNC)->apply(Actions\CreateAction::make())
|
|
->visible(fn (): bool => $this->tableHasRecords()),
|
|
];
|
|
}
|
|
|
|
protected function getTableEmptyStateActions(): array
|
|
{
|
|
return [
|
|
UiEnforcement::for(Capabilities::TENANT_SYNC)->apply(Actions\CreateAction::make()),
|
|
];
|
|
}
|
|
}
|