plugin list works now finally
This commit is contained in:
62
app/Filament/Pages/Plugins.php
Normal file
62
app/Filament/Pages/Plugins.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Filament\Forms\Contracts\HasForms;
|
||||
use Filament\Forms\Concerns\InteractsWithForms;
|
||||
use App\Models\Plugin;
|
||||
|
||||
class Plugins extends Page implements Tables\Contracts\HasTable, HasForms
|
||||
{
|
||||
use Tables\Concerns\InteractsWithTable;
|
||||
use InteractsWithForms;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-puzzle-piece';
|
||||
|
||||
protected static ?string $navigationGroup = 'Plugins';
|
||||
|
||||
protected static ?string $title = 'Plugins';
|
||||
|
||||
protected static string $view = 'filament.pages.plugins';
|
||||
|
||||
protected static ?string $slug = 'list-plugins';
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->query(Plugin::query()) // Use a dummy query
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('name')
|
||||
->label('Name')
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('identifier')
|
||||
->label('Identifier'),
|
||||
Tables\Columns\IconColumn::make('enabled')
|
||||
->label('Enabled')
|
||||
->boolean(),
|
||||
Tables\Columns\IconColumn::make('configured')
|
||||
->label('Configured')
|
||||
->boolean()
|
||||
->tooltip(fn ($record) => $record->configured ? 'Has ApiProvider record' : 'No ApiProvider record'),
|
||||
Tables\Columns\TextColumn::make('file_path')
|
||||
->label('File Path')
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
]);
|
||||
}
|
||||
|
||||
public function getTableRecords(): \Illuminate\Database\Eloquent\Collection
|
||||
{
|
||||
// Get all plugins as a collection
|
||||
return Plugin::getAllPlugins();
|
||||
}
|
||||
|
||||
public function currentlyValidatingForm(\Filament\Forms\ComponentContainer|null $form): void
|
||||
{
|
||||
// No form validation needed for this page
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user