eightynine/filament-master-detail is a Laravel package for this is my package filament-master-detail.
It currently has 1 GitHub stars and 1 downloads on Packagist.
Install it with composer require eightynine/filament-master-detail.
Discover more Laravel packages by eightynine
or browse all Laravel packages to compare alternatives.
Last updated
This package adds a master–detail layout for Filament resources. It renders a table on the left and the selected record’s page on the right, with pagination and deep links preserved.
You can install the package via Composer:
composer require eightynine/filament-master-detail
Publish and run the migrations:
php artisan vendor:publish --tag="filament-master-detail-migrations"
php artisan migrate
Publish the config file:
php artisan vendor:publish --tag="filament-master-detail-config"
Optionally, publish the views:
php artisan vendor:publish --tag="filament-master-detail-views"
After publishing, you can customize settings in config/master-detail.php.
This is the contents of the published config file (currently no options; reserved for future use):
return [
];
use App\Providers\Filament\AdminPanelProvider; // or your custom Panel provider
use Filament\Panel;
use EightyNine\MasterDetail\MasterDetailPlugin;
use App\Filament\Resources\CustomerResource; // example
use App\Filament\Resources\OrderResource; // example
class AdminPanelProvider extends AdminPanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ... other panel config
->plugin(MasterDetailPlugin::make()
->scopes([
OrderResource::class
]));
}
}
getMasterDetailColumns() to define the table columns used in the master–detail view:use Filament\Tables;
use Filament\Tables\Columns\TextColumn;
public function getMasterDetailColumns(): array
{
return [
TextColumn::make('id')->label('ID')->sortable(),
TextColumn::make('name')->searchable()->toggleable(),
// add more columns as needed
];
}
Optional (advanced):
public static function modifyMasterDetailQuery(\Illuminate\Database\Eloquent\Builder $query)
{
return $query->latest();
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.