tomatophp/filament-bookmarks-menu

Add bookmarks and tags to your resources records and access theme form your sidebar

v1.0.3 2024-09-17 16:49 UTC

This package is auto-updated.

Last update: 2024-10-17 17:00:30 UTC


README

Screenshot

Filament Bookmarks Menu

Latest Stable Version License Downloads

Add bookmarks and tags to your resources records and access theme form your sidebar

Screenshots

Bookmark Menu Create Modal Add Bookmark Remove Bookmark Bookmark Page Bookmark Actions Bookmark Edit Bookmark Bulk Actions

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