
Laravel 8 Authentication Setup
Step 1: Install Laravel 8
To install a new Laravel application, run the following command in your terminal:
composer create-project --prefer-dist laravel/laravel template_dashboard
Step 2: Install Laravel UI
Next, install Laravel UI and set up authentication with Vue.js:
composer require laravel/ui php artisan ui vue --auth
Step 3: Configure Database & Mail Credentials
1. Database Configuration
Open your .env
file (located in the project root) and update the database details:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_db
DB_USERNAME=root
DB_PASSWORD=your_database_password
2. Email Configuration (For Password Reset)
To enable email functionality for password resets, update the following mail settings in your .env
file:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your_email
MAIL_PASSWORD=your_email_password
MAIL_ENCRYPTION=tls
Step 4: Run Migrations
Execute the following command to create the necessary database tables:
php artisan migrate
Step 5: Start the Development Server
Run the Laravel development server with:
php artisan serve
Step 6: Access the Application
Open your browser and visit:
http://localhost/template_dashboard/public/
Now, your authentication system, including login, registration, and password reset functionality, is set up and ready to use!