🚀 Basic DDEV Project Commands
Command | Purpose |
---|---|
ddev start |
Start your Laravel project environment |
ddev stop |
Stop the environment |
ddev restart |
Restart the environment (after config changes) |
ddev ssh |
SSH into the container (important for artisan commands, composer, etc.) |
ddev list |
List all running DDEV projects |
ddev describe |
Show project details and URL |
🛠 Laravel-Specific Workflow Inside the Container (ddev ssh
)
Command | Purpose |
---|---|
php artisan migrate |
Run database migrations |
php artisan migrate:fresh |
Drop all tables and re-run all migrations |
php artisan db:seed |
Seed the database with dummy/test data |
php artisan make:model ModelName -m |
Create a new model and migration |
php artisan make:controller ControllerName |
Create a new controller |
php artisan make:migration create_table_name |
Create a new migration |
php artisan serve |
(Not needed usually with DDEV – you access via DDEV’s routing) |
📦 Composer Commands
Command | Purpose |
---|---|
composer install |
Install PHP dependencies (from composer.lock) |
composer update |
Update PHP dependencies |
composer dump-autoload |
Regenerate autoload files (after adding classes manually) |
🧹 Cache and Maintenance
Command | Purpose |
---|---|
php artisan config:cache |
Rebuild configuration cache |
php artisan route:cache |
Rebuild route cache |
php artisan view:clear |
Clear compiled Blade views |
php artisan cache:clear |
Clear application cache |
php artisan config:clear |
Clear config cache |
⚙️ Database Access
Command | Purpose |
---|---|
ddev mysql |
Open MySQL client connected to the Laravel database |
ddev sequelpro or ddev heidisql |
Launch database GUI apps connected to DDEV DB |
🧪 Testing and Development Extras
Command | Purpose |
---|---|
php artisan test |
Run PHPUnit tests |
php artisan tinker |
Open Tinker REPL to interact with app models/data |
Bonus 🌟
If you ever need to install Laravel inside DDEV from scratch:
ddev composer create "laravel/laravel my-project-name"
(inside your project’s /var/www/html
directory after ddev ssh
)