Laravel 9 Auth Scaffolding UI without npm package
13-03-2022
| Share:
Whatsapp
https://fundaofwebit.com/post/laravel-9-auth-scaffolding-ui-without-npm-package
Copy Link
Laravel 9 Auth Scaffolding UI without npm package.
In this post, we will see about how to install auth in laravel 9 for complete login and registration system.
Step 1: Create a laravel 9 application via composer.
composer create-project laravel/laravel laravelproject
Step 2: Setup Database Configuration in .env file
DB_CONNECTION =mysql
DB_HOST =127.0.0.1
DB_PORT =3306
DB_DATABASE =laravel
DB_USERNAME =root
DB_PASSWORD =
Step 3: Install Laravel UI Package using the following commad .
composer require laravel/ui
Step 4: Generate Auth Scaffolding using the following command.
php artisan ui:auth
Step 5: migrate the table into database using the following command.
php artisan migrate
Step 6: lets start or serve the application with the following command.
php artisan serve
Now, we are successfully setup with the Auth Scaffolding.
Note: Your login, register, password reset, etc files will not designed, so to make it better and response please add bootstrap CDN links as shown below:
Bootstrap 5 CSS - CDN Link:
< link href ="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel ="stylesheet" >
Bootstrap 5 JS - CDN Link
< script src ="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" ></ script >
Step 7: Add these above CDN links in app.blade.php in the following path: resources/views/layouts/app.blade.php
<! doctype html >
< html lang =" {{ str_replace ('_', '-', app () ->getLocale ()) }} " >
< head >
< meta charset ="utf-8" >
< meta name ="viewport" content ="width=device-width, initial-scale=1" >
<!-- CSRF Token -->
< meta name ="csrf-token" content =" {{ csrf_token () }} " >
< title > {{ config ('app.name' , 'Laravel' ) }} </ title >
<!-- Scripts -->
< script src =" {{ asset ('js/app.js') }} " defer ></ script >
<!-- Fonts -->
< link rel ="dns-prefetch" href ="//fonts.gstatic.com" >
< link href ="https://fonts.googleapis.com/css?family=Nunito" rel ="stylesheet" >
<!-- Styles -->
< link href =" {{ asset ('css/app.css') }} " rel ="stylesheet" >
< link href ="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel ="stylesheet" >
</ head >
< body >
< div id ="app" >
< main class ="py-4" >
@yield ('content' )
</ main >
</ div >
< script src ="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" ></ script >
</ body >
</ html >
Thank you.