Install the package via composer:
composer require spatie/laravel-sluggable
The service provider is registered automatically via Laravel package discovery.
##Publishing the config file (optional)
The package ships with a config file that lists overridable actions. Publishing it is only required if you want to swap one of the default actions for your own class.
php artisan vendor:publish --tag=sluggable-config
The published file will look like this:
return [
'actions' => [
'generate_slug' => Spatie\Sluggable\Actions\GenerateSlugAction::class,
'build_self_healing_route_key' => Spatie\Sluggable\Actions\BuildSelfHealingRouteKeyAction::class,
'extract_identifier_from_self_healing_route_key' => Spatie\Sluggable\Actions\ExtractIdentifierFromSelfHealingRouteKeyAction::class,
],
];
See Overriding actions for details.