Post

Generating Slugs from a Title in Filament

Generating Slugs from a Title in Filament

Original Article: Generating Slugs from a Title in Filament


Filament is a powerful Laravel admin panel framework that makes building admin interfaces a breeze. In this article, we’ll explore how to generate slugs from a title using Filament.

Introduction

Slugs are user-friendly URL components derived from the title of a resource. They are essential for creating clean and readable URLs. Filament simplifies the process of generating slugs by providing convenient methods.

Generating Slugs in Filament

Filament uses the Spatie\Sluggable package under the hood for slug generation. To use slugs in your Filament models, follow these steps:

1. Install Spatie Sluggable Package

Add the Spatie Sluggable package to your Laravel project using Composer:

1
composer require spatie/laravel-sluggable