finished the upgrade to filament 4. completely revamped the frontend with codex, now it looks great!
This commit is contained in:
@@ -2,30 +2,31 @@
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use Filament\Pages\Page;
|
||||
use App\Models\Plugin;
|
||||
use BackedEnum;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
use UnitEnum;
|
||||
|
||||
class Plugins extends Page
|
||||
class Plugins extends Page implements Tables\Contracts\HasTable
|
||||
{
|
||||
protected static ?string $navigationIcon = 'heroicon-o-puzzle-piece';
|
||||
use Tables\Concerns\InteractsWithTable;
|
||||
|
||||
protected static ?string $navigationGroup = 'Plugins';
|
||||
protected static string|BackedEnum|null $navigationIcon = 'heroicon-o-puzzle-piece';
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Plugins';
|
||||
|
||||
protected static ?string $navigationLabel = 'Plugin List';
|
||||
|
||||
protected static ?string $title = 'Plugins';
|
||||
|
||||
protected static string $view = 'filament.pages.plugins';
|
||||
protected string $view = 'filament.pages.plugins';
|
||||
|
||||
protected static ?string $slug = 'list-plugins';
|
||||
|
||||
public $plugins;
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->plugins = Plugin::getAllPlugins();
|
||||
}
|
||||
|
||||
public static function getNavigationGroup(): ?string
|
||||
{
|
||||
return __('filament.navigation.groups.plugins');
|
||||
@@ -35,4 +36,29 @@ class Plugins extends Page
|
||||
{
|
||||
return __('filament.navigation.plugin_list');
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('name')
|
||||
->label(__('Name'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('identifier')
|
||||
->label(__('Identifier'))
|
||||
->searchable()
|
||||
->sortable(),
|
||||
IconColumn::make('enabled')
|
||||
->label(__('Enabled'))
|
||||
->boolean(),
|
||||
IconColumn::make('configured')
|
||||
->label(__('Configured'))
|
||||
->boolean(),
|
||||
])
|
||||
->records(fn () => Plugin::getAllPlugins())
|
||||
->paginated(false)
|
||||
->emptyStateHeading(__('No plugins found'))
|
||||
->emptyStateDescription(__('Drop PHP plugin files into app/Api/Plugins (excluding ApiPluginInterface.php).'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user