novius/laravel-filament-slug
TextInput, ensuring visual and functional consistency with other Filament fields (e.g., validation, rules, and UI behavior).Str::slug()) behind a clean API, reducing cognitive load for developers. The fromField() method abstracts the dynamic relationship between a source field (e.g., title) and the slug, which is a common pattern in CMS/e-commerce applications.Resource/Page model, where slugs are typically tied to editable entities (e.g., blog posts, products). Avoids global state or external dependencies, keeping the scope contained.use Novius\FilamentSlug\Fields\Slug) and minimal configuration (e.g., ->fromField($title)). No database migrations, service providers, or complex setup.TextInput).description) via fromField().is_draft is true).TextInput methods (e.g., required(), regex(), unique()) are available, allowing fine-grained control over slug validation.-2 to /post). Requires application-level logic (e.g., database constraints or custom observers).Str::slug() overrides.live(false) or defer generation via afterStateUpdated.unique() method?TextInput with afterStateUpdated or a custom Livewire component achieve the same result with less risk?/blog/how-to-laravel)./products/premium-headphones)./projects/abc-123).spatie/laravel-sluggable for model-level slug handling.laravel-seo or similar packages for meta tags.Table actions for batch slug updates.Str::slug($request->title)) or missing.Resource (e.g., a blog post or product) to test the integration.TextInput: Replace manual slug fields with Slug::make():
// Before
TextInput::make('slug')->required()->unique(Post::class, 'slug'),
// After
Slug::make('slug')->fromField($title)->required()->unique(Post::class, 'slug'),
is_published is false).unique constraints work).Resources, starting with the most critical.rules().spatie/laravel-sluggable (if using model-level slug management).Str::slug() overrides (for localization).slug vs. route_slug).TextInput.slug columns exist in models where the field is used.composer require novius/laravel-filament-slug.php artisan vendor:publish --provider="Novius\FilamentSlug\FilamentSlugServiceProvider".TextInput with Slug::make() in form() methods.fromField() to bind slugs to source fields (e.g., title).unique, regex).{title}-{id}).Str::slug() calls and manual validation.Resources.How can I help you explore Laravel packages today?