← Back to Command Library

Laravel

Laravel 11 Project Setup (Windows/XAMPP)

Create a new Laravel project, configure env, and run migrations.

Practical command flow for a clean Laravel local setup.

Version

Laravel 11, PHP 8.2+

Tags

laravel,composer,php,setup,migration

Views

7

Problem

Developers often face environment mismatch and app key or migration issues during first setup.

Solution Summary

Follow these commands in sequence to bootstrap Laravel correctly from scratch.

Step 1

composer create-project laravel/laravel myapp
Note: Create a fresh Laravel project.

Step 2

cd myapp
Note: Move into the project directory.

Step 3

copy .env.example .env
Note: Windows command. Use cp on Linux/macOS.

Step 4

php artisan key:generate
Note: Generate APP_KEY.

Step 5

php artisan migrate
Note: Run database migrations after DB config in .env.

Step 6

php artisan serve
Note: Start the local development server.

Related Commands