tomatophp / filament-bookmarks-menu
Add bookmarks and tags to your resources records and access theme form your sidebar
Fund package maintenance!
3x1io
Requires
- php: ^8.1
- filament/filament: ^3.0
- tomatophp/console-helpers: ^1.1
- tomatophp/filament-icons: ^1.0
This package is auto-updated.
Last update: 2024-10-17 17:00:30 UTC
README
Filament Bookmarks Menu
Add bookmarks and tags to your resources records and access theme form your sidebar
Screenshots
Installation
composer require tomatophp/filament-bookmarks-menu
after install your package please run this command
php artisan filament-bookmarks-menu:install
finally register the plugin on /app/Providers/Filament/AdminPanelProvider.php
->plugin(\TomatoPHP\FilamentBookmarksMenu\FilamentBookmarksMenuPlugin::make())
Usage
you can add bookmark action to your page like this
use TomatoPHP\FilamentBookmarksMenu\Filament\Actions\BookmarkAction; protected function getHeaderActions(): array { return [ BookmarkAction::make() ]; }
or to your table like this
use TomatoPHP\FilamentBookmarksMenu\Filament\Tables\BookmarkAction; public function table(Table $table): void { $table->actions([ BookmarkAction::make() ]); }
or to your table bulk actions like this
use TomatoPHP\FilamentBookmarksMenu\Filament\Tables\BookmarkBulkAction; use TomatoPHP\FilamentBookmarksMenu\Filament\Tables\BookmarkBulkClearAction; public function table(Table $table): void { $table->bulkActions([ Tables\Actions\BulkActionGroup::make([ BookmarkBulkAction::make(), BookmarkBulkClearAction::make() ]), ]); }
Create Custom Bookmark Type
you can create custom bookmark type by use our Facade TomatoPHP\FilamentBookmarksMenu\Facades\FilamentBookmarksMenu
register method like this
use TomatoPHP\FilamentBookmarksMenu\Facades\FilamentBookmarksMenu; use TomatoPHP\FilamentBookmarksMenu\Services\Contracts\BookmarkType; public function boot() { FilamentBookmarksMenu::register([ BookmarkType::make('hashtags')->label('Hashtags')->panel('employee'), BookmarkType::make('folder')->label('Folders'), ]); }
to make label translatable you can use your path direct on label like this ->label('filament.bookmarks-menu::labels.hashtags')
Publish Assets
you can publish config file by use this command
php artisan vendor:publish --tag="filament-bookmarks-menu-config"
you can publish views file by use this command
php artisan vendor:publish --tag="filament-bookmarks-menu-views"
you can publish languages file by use this command
php artisan vendor:publish --tag="filament-bookmarks-menu-lang"
you can publish migrations file by use this command
php artisan vendor:publish --tag="filament-bookmarks-menu-migrations"
Other Filament Packages
Checkout our Awesome TomatoPHP