Laravel 8 Setup Tutorial: Form Select with Login and Dashboard
This guide will help you set up a Laravel 8 project with user login, email configuration for password resets, and a simple dashboard UI.
Step 1: Install Laravel 8
Open your terminal and run the following command to create a new Laravel project:
Step 2: Configure .env
File
Update your database and mail credentials in the .env
file located at the root of your Laravel project.
Database Configuration:
Email Configuration (For Forgot Password Feature):
Step 3: Run Migrations
Once the DB is configured, create your tables by running:
Step 4: Add Dashboard UI
Create or update the file at resources/views/dashboard/dashboard.blade.php
and add the following snippet to display today's absentees:
Step 7: Create Login Controller
Generate a controller for login logic:
Then, update it as needed in app/Http/Controllers/Auth/LoginController.php
:
Step 9: Add Routes
Open routes/web.php
and define your routes:
Step 10: Run Development Server
Start the Laravel development server:
Now, open your browser and go to:
You should see your login page and be able to navigate to the dashboard after logging in.
Final Tips
-
Don't forget to run
php artisan make:auth
(Laravel UI) or use Jetstream/Breeze for full auth scaffolding. -
Make sure your
uploads
,storage
, andbootstrap/cache
folders are writable (chmod -R 775
if needed). -
You can use Laravel's Mail functionality to test password reset emails.
Let me know if you'd like me to package this into a downloadable .zip
, or if you want to expand with roles, permissions, or charts in the dashboard!