Check Username availability using Livewire
Tech Stack: bootstrap-5, livewire
Demo
Create New Account (Username checker Demo)
Code
Sorry, this component's code is restricted
Get Livewiredemos-Pro
Sorry, this component's code is restricted
Get Livewiredemos-Pro
Usage
@livewire('check-username-availability')
Documentation
We have used the updated lifecycle hook Livewire to check if the username exists in the database.
Laravel validation provides a unique validator that helps us check this. If the username already exists the validation method adds a message to the error message bag. If not we add a success message to the session.