Laravel 8 Authentication with Vue UI
Step 1: Install Laravel 8
Create a new Laravel project by running the following command in your terminal:
composer create-project --prefer-dist laravel/laravel dashboard_version7
Step 2: Install Laravel UI and Vue Auth Scaffolding
To add Vue.js authentication scaffolding, install the Laravel UI package:
composer require laravel/ui
Then generate the Vue frontend with built-in authentication:
php artisan ui vue --auth
(Optional) Install and compile frontend assets:
npm install && npm run dev
Step 3: Configure Database Credentials
Open the .env
file located in the root of your project, and update the database settings:
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_db DB_USERNAME=root DB_PASSWORD=your_password
Replace your_db
and your_password
with your actual database name and password.
Step 4: Run Migrations
Run the migration command to create the default tables required for authentication:
php artisan migrate
Step 5: Start the Development Server
Finally, start the Laravel development server:
php artisan serve
Now, open your browser and visit the following URL to access the login/register page:
http://localhost:8000
If you're running Laravel in a subdirectory (like with XAMPP or similar), use:
http://localhost/dashboard_version7/public/