Livewire Auto Generate Slug from Title
Tech Stack: bootstrap-5, livewire
Demo
Auto Generate Slug from Title
Tasks List
Name | Slug |
---|---|
Necessitatibus omnis id impedit et. | |
Reprehenderit maiores quia ipsam natus. | |
Sunt sunt ratione omnis similique. | |
Numquam sed molestias dolores ut perferendis distinctio. | |
Quibusdam et modi esse quibusdam non blanditiis eum eveniet. |
Code
Sorry, this component's code is restricted
Get Livewiredemos-Pro
Sorry, this component's code is restricted
Get Livewiredemos-Pro
Usage
@livewire('slug-generator')
Documentation
This is an auto slug generator, that generates a slug that can be used to make SEO-friendly URLs.
Implementation is done using the updated lifecycle hook of Livewire. Whenever the user types into the title field it invokes the updatedTitle method and in there we use Laravel's String helper method to generate the slug.