Livewire Auto Generate Slug from Title
Tech Stack: bootstrap-5, livewire
Demo
Auto Generate Slug from Title
Tasks List
Name | Slug |
---|---|
Ut laboriosam reiciendis eos ratione dolorem excepturi libero. | |
Consequatur voluptatem voluptates qui est. | |
Ut culpa deserunt tenetur asperiores. | |
Esse animi animi illum quidem voluptatum. | |
Distinctio mollitia non distinctio aliquam. |
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.