
Laravel 8 Installation and Authentication Setup
Follow these steps to install Laravel 8, set up authentication, and run your application:
Step 1: Install Laravel 8
First, install a new Laravel application by running the following command in your terminal:
composer create-project --prefer-dist laravel/laravel dashboard_version6
This will create a new Laravel project in a folder named dashboard_version6
.
Step 2: Install Laravel UI Package
To set up basic authentication scaffolding with Vue.js, install the Laravel UI package:
composer require laravel/ui
Next, generate the frontend scaffolding with authentication:
php artisan ui vue --auth
This will scaffold basic login, registration, password reset features, and Vue.js setup.
Step 3: Configure Database
Open your .env
file located at the root of your project, and update your database credentials:
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_db DB_USERNAME=root DB_PASSWORD=your_database_password
Replace your_db
and your_database_password
With your actual database name and password.
Step 4: Run Migrations
After setting up your database, run the migrations to create the necessary tables:
php artisan migrate
Step 5: Run the Development Server
Finally, start the Laravel development server:
php artisan serve
After running the server, open your browser and visit:
http://localhost:8000
Or if you're accessing through the /public
folder directly:
http://localhost/dashboard_version6/public/
You should now see the login and registration pages working!
That's it!
You've installed Laravel 8, set up authentication, connected to a database, and launched your development server.