| Package Data | |
|---|---|
| Maintainer Username: | tomhatzer |
| Maintainer Contact: | mail@benjaminhirsch.net (Benjamin Hirsch) |
| Package Create Date: | 2018-08-25 |
| Package Last Update: | 2023-12-27 |
| Language: | Vue |
| License: | MIT |
| Last Refreshed: | 2025-11-02 15:19:43 |
| Package Statistics | |
|---|---|
| Total Downloads: | 1,088,461 |
| Monthly Downloads: | 4,890 |
| Daily Downloads: | 83 |
| Total Stars: | 142 |
| Total Watchers: | 4 |
| Total Forks: | 25 |
| Total Open Issues: | 7 |
Simple Laravel Nova Slug field. Generating a slugified version of a text input. See the result of the slug while typing.

In order to use this package, you need a Laravel installation which uses Nova.
Composer
composer require benjaminhirsch/nova-slug-field
Define the following fields in your resource in the fields method:
use Benjaminhirsch\NovaSlugField\Slug;
use Benjaminhirsch\NovaSlugField\TextWithSlug;
...
TextWithSlug::make('Name')
->slug('slug'),
Slug::make('Slug'),
This will display the full URL including the generated slug as a link below the input field.
use Benjaminhirsch\NovaSlugField\Slug;
use Benjaminhirsch\NovaSlugField\TextWithSlug;
...
TextWithSlug::make('Name')
->slug('slug'),
Slug::make('Slug')
->showUrlPreview('http://www.foo.bar'),
This is especially usefull, when you are updating the field which the slug belongs to and don't wan't the slug to be updated automatically.
use Benjaminhirsch\NovaSlugField\Slug;
use Benjaminhirsch\NovaSlugField\TextWithSlug;
...
TextWithSlug::make('Name')
->slug('slug'),
Slug::make('Slug')
->disableAutoUpdateWhenUpdating(),
This first field definition is the field which you want to create the slug of. The second field
definition represents the slugified version. With the ->slug('name') method, you define
the name of the field which holds the slug. It is possible to create multiple slugs on a single
resource, just add more field definitions. Every TextWithSlug field needs a corresponding
Slug field.