Laravel8 - Registration and Login using Laravel UI
Here we are going to see how do we create laravel 8 login and authentication application. Assuming that you are already install xampp / lampp, composer and code editor on your system. if they are not installed then install them first and start xampp/lampp server on your system.
Install Laravel 8
Open the command window or terminal window
composer create-project laravel/laravel:^8.0 laravel8-app
cd laravel8-app
Database Connection
Create the Mysql database and give the database credentials on .env file to for interacting your apllication with database.
Install Laravel UI
Installl laravel UI for login authentication
composer require laravel/ui
php artisan ui bootstrap --auth
php artisan migrate
Install npm modules
Install node modules and dependencies and compiles css assets using the npm command
npm install
npm run dev
Resolve the mix error if any
if you face any mix related error like "'mix' is not recognized as an internal or external command....". perform the following steps
npm install laravel-mix@latest --save-dev
change the scripts section on package.json with following
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
Run the following commands on your application root directory's terminal or command window.
npm run dev
php artisan serve
Open the browser and put "http://localhost:8080" on address bar. Now you can see the laravel landing page with login and Register link.
Final result or output
Congratulation, Finally you have created a laravel 8 application with login and registration. Thus you can customize youe application with your wish.