1. Create a New Laravel Project
First, navigate to your wamp64/www folder (or your preferred location), then run:
composer create-project laravel/laravel login
This will create a new Laravel project named login.
2. Set Up the Database
-
Create a new database in phpMyAdmin (e.g.,
login_db). -
Open the
.envfile in your Laravel project and configure your database settings:
DB_DATABASE=login_dbDB_USERNAME=rootDB_PASSWORD=
3. Fix Default String Length (for older MySQL versions)
In App\Providers\AppServiceProvider.php, update the boot method to fix key length issues:
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
4. Install and Setup Laravel Breeze (Built-in in Laravel 10+)
Laravel Breeze is now easy to set up:
composer require laravel/breeze --dev
php artisan breeze:install
npm install && npm run dev
php artisan migrate
✅ This sets up:
-
A landing page (
/) -
A login page (
/login) -
A registration page (
/register) -
A dashboard page (
/dashboard)
5. Run the Application
Start the development server:
php artisan serve
Then open http://127.0.0.1:8000 in your browser.
🧾 Features You Now Have
-
✅ Welcome landing page
-
✅ Login functionality
-
✅ User registration
-
✅ Protected dashboard (only accessible after login)
You’re now ready to expand the app by adding roles, user management, and more features.
No comments:
Post a Comment