Slug

You're browsing the documentation for an old version of MoonShine. Consider upgrading your project to MoonShine 2.x.

Extends Text * has the same features

Using this field you can generate a slug based on the selected field and keep it unique too

//...
use MoonShine\Fields\Slug;
 
public function fields(): array
{
return [
Slug::make('Slug')->from('title')->separator('-')->unique(),
];
}
 
//...