Laravel 11 UI provides built-in Bootstrap authentication system, which provides users with default login, registration, forgotten password, password reset, email verification pages with functionality using Bootstrap authentication in Laravel applications.
In this guide, we will teach you how to install and use default bootstrap auth scaffolding in laravel 11 applications.
Steps on How to Install and Use Bootstrap Auth Scaffolding in Laravel 11
Here are steps:
Step 1 – Download New Laravel Application
Open cmd and run the following command to install and setup new laravel 11 application into your server:
//for windows user cd xampp/htdocs //for ubuntu user cd var/www/html composer create-project --prefer-dist laravel/laravel BootStrapAuth
Step 2 – Initialize Database with Application
Open .env
file from root folder of laravel application and configure database in it; something like this:
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=db name DB_USERNAME=db user name DB_PASSWORD=db password
Step 3 – Install Laravel UI
Run the composer require laravel/ui
on cmd to install laravel UI in the application:
cd BootStrapAuth composer require laravel/ui
Step 4 – Install Bootstrap Auth
To install default bootstrap auth, just run the following command:
php artisan ui bootstrap --auth
Step 5 – Install NPM and Run Dev
Run npm install && npm run dev
command on cmd to install required npm packages in application:
npm install && npm run dev
Step 6 – Run php artisan Migrate
Open new cmd window and navigate to application folder using cd
command, and then run the php artisan migrate
command in it to create tables in database:
cd /xampp/htdocs/BootStrapAuth php artisan migrate
Step 7 – Run and Test Application
Run application server using php artisan serve
command:
php artisan serve
Now, open the browser and hit the following url on it:
http://127.0.0.1:8000/
Conclusion
We hope this guide helped you install and use bootstrap Auth using UI in laravel 11 application.