novius/laravel-filament-publishable
Add Laravel Publishable support to Filament resources: ready-made form fields, table column, filter, and bulk action to manage publication status plus published/expired dates for your Eloquent models. Compatible with Laravel 11+, Filament 4+.
This package allows you to manage Laravel Models which use Laravel Publishable in Laravel Filament.
NOTE: These instructions are for Laravel >= 10.0 and PHP >= 8.2 If you are using prior version, please see the previous version's docs.
You can install the package via composer:
composer require novius/laravel-filament-publishable
Insert Publishable fields, action and filter on your Filament Resource.
use Filament\Resources\Resource;
class Post extends Resource
{
public static function form(Form $form): Form
{
return $form
->schema([
// ...
PublicationStatus::make('publication_status'),
PublishedAt::make('published_at'),
ExpiredAt::make('expired_at'),
PublishedFirstAt::make('expired_at'),
// ...
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
// ...
PublicationColumn::make('publication_status'),
// ...
])
->filters([
// ...
PublicationStatusFilter::make('publication_status'),
// ...
])
->bulkActions([
// ...
PublicationBulkAction::make(),
// ...
]);
}
If you want to customize the lang files, you can publish them with:
php artisan vendor:publish --provider="Novius\LaravelFilamentPublishable\LaravelNovaPublishableServiceProvider" --tag="lang"
Lint your code with Laravel Pint using:
composer run-script lint
This package is under GNU Affero General Public License v3 or (at your option) any later version.
How can I help you explore Laravel packages today?