PHP code example of miguilim / filament-auto-panel
1. Go to this page and download the library: Download miguilim/filament-auto-panel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
miguilim / filament-auto-panel example snippets
use Miguilim\FilamentAutoPanel\Mounters\RelationManagerMounter;
public static function getRelations(): array
{
return [
RelationManagerMounter::make(
resource: static::class,
relation: 'userBans',
recordTitleAttribute: 'Bans',
visibleColumns: ['reason', 'created_at'],
),
];
}
use Miguilim\FilamentAutoPanel\AutoAction;
use Illuminate\Database\Eloquent\Collection;
public static function getActions(): array
{
return [
AutoAction::make('refund')
->label('Refund')
->icon('heroicon-o-arrow-path')
->color('danger')
->action(fn (Collection $records) => $records->each->refund())
->showOnTable()
->showOnViewPage(),
];
}