Slug
Plugin to generate and manage slugs automatically.
Author:
Novius
Documentation
#Introduction
This package add a Slug field to Filament Forms
#Requirements
- PHP >= 8.2
- Laravel >= 11.0
- Laravel Filament >= 4
#Installation
composer require novius/laravel-filament-slug
#Usage
class YourResource extends Resource
{
public static function form(Form $form): Form
{
return $form
->schema([
$title = TextInput::make('title')
->required(),
Slug::make('slug')
// First parameter of fromField() must be the TextInput instance from which the slug is generated.
// Second parameter is optional. If passed, must be a closure returning if the slug generation should be skip or not.
->fromField($title, fn (Get $get) => ! $get('other_value'))
// Slug inherit from TextInput. You can use all other method of TextInput.
->required()
->string()
->regex('/^(\/|[a-zA-Z0-9-_]+)$/')
->unique(
YourModel::class,
'slug',
ignoreRecord: true
),
]);
}
}
#Lint
Run php-cs with:
composer run-script lint
#Contributing
Contributions are welcome!
Leave an issue on GitHub, or create a Pull Request.
#Licence
This package is under GNU Affero General Public License v3 or (at your option) any later version.
The author
Novius is a French web agency specializing in the development of tailor-made web applications with Laravel.
We design robust, maintainable and business-oriented tools, with particular attention paid to the developer experience and the sustainability of projects. Our Filament plugins are used in production on customer projects and are designed to meet concrete needs, proven in the field.
From the same author
Action Preview
Action to preview a resource before saving or publishing it.
Author:
Novius
Relation Nested
Plugin to manage nested relationships using the Nested Set model.
Author:
Novius
Page Manager
Plugin to manage pages and structured content from the admin panel.
Author:
Novius
Redirect Manager
Plugin to manage URL redirections directly from the admin panel.
Author:
Novius
Featured Plugins
A selection of plugins curated by the Filament team
Custom Dashboards
Let your users build and share their own dashboards with a drag-and-drop interface. Define your data sources in PHP and let them do the rest.
Filament
Custom Fields
Eliminate custom field migrations forever. Let your users create and manage form fields directly in Filament admin panels with 20+ built-in field types, validation, and zero database changes.
Relaticle
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese