PHP code example of harvirsidhu / filament-action-overflow
1. Go to this page and download the library: Download harvirsidhu/filament-action-overflow 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/ */
harvirsidhu / filament-action-overflow example snippets
use Filament\Actions\Action;
use Filament\Actions\ActionGroup;
public function getHeaderActions(): array
{
return ActionGroup::make([
Action::make('edit'),
Action::make('archive'),
Action::make('delete'),
])->withOverflow(); // keep 1 primary, overflow the rest
}
use Filament\Actions\Action;
use Harvirsidhu\FilamentActionOverflow\Facades\ActionOverflow;
return ActionOverflow::make([
Action::make('edit'),
Action::make('archive'),
Action::make('delete'),
])
->primaryCount(2)
->label('Options')
->icon('heroicon-m-bars-3')
->color('gray')
->toActions();
// More: tuck the extras away
ActionGroup::make([$edit, $archive, $delete])->withOverflow();
// Split: one action and its variants
ActionGroup::make([$callNext, $toCounterOne, $toCounterTwo])->withSplit();
use Filament\Support\Enums\IconPosition;
use Filament\Support\Icons\Heroicon;
ActionOverflow::make($actions)
->label(__('Manage')) // trigger text, used as given
->icon(Heroicon::EllipsisVertical) // string | BackedEnum | Filament icon enum
->iconPosition(IconPosition::Before) // 'before' | 'after' | IconPosition enum
->color('danger') // any Filament color name
->hiddenLabel() // icon-only trigger (where supported)
->toActions();
use Harvirsidhu\FilamentActionOverflow\Enums\MorePosition;
ActionOverflow::make($actions)
->morePosition(MorePosition::Start) // or the string 'start'
->toActions();