camya/filament-title-with-slug
TitleWithSlugInput) without requiring changes to existing models or controllers. Configuration is done via the component’s static make() method.title and slug) in the target model, but these are common for SEO-friendly URLs. Migration is straightforward if fields don’t exist.Str::slug()) is sufficient for most cases.route(); ensure the project’s routes are properly defined for dynamic slugs (e.g., posts.show).{slug}) already implemented for the target models?composer require filament/filament livewire/livewire
config/app.php.composer require camya/filament-title-with-slug
Publish config (if needed) and update config/filament.php.title and slug fields to the target model (if missing). Example migration:
Schema::table('posts', function (Blueprint $table) {
$table->string('title')->nullable()->change();
$table->string('slug')->nullable()->unique()->after('title');
});
use Camya\FilamentTitleWithSlug\Forms\Components\TitleWithSlugInput;
TitleWithSlugInput::make()
->titleField('title')
->slugField('slug')
->required()
->rules(['slug' => 'unique:posts,slug'])
->columnSpanFull(),
Route::get('/posts/{slug}', [PostController::class, 'show']) exist.composer.json for exact versions).Str::slug()).resources/views/vendor/filament-title-with-slug/...).composer.json if stability is critical.livewire:wire:log) can diagnose component issues.slug column:
Schema::table('posts', function (Blueprint $table) {
$table->string('slug')->unique();
});
| Scenario | Impact | Mitigation |
|---|---|---|
| Slug collision | Duplicate slugs saved | Add unique rule to form validation. |
| Route misconfiguration | "Visit" link breaks | Test routes in staging. |
| Package update breaks | Component renders incorrectly | Pin versions or fork the package. |
| Custom slugifier fails | Invalid slugs generated | Fallback to default Str::slug(). |
How can I help you explore Laravel packages today?