• Skip to primary navigation
  • Skip to main content
  • Skip to footer
916 Maketing Logo
  • About
  • Services
    • Marketing
    • Search Engine Optimization
    • Web Development
    • Web Design
  • Work
  • Blog
  • Contact Us

Common DDEV Commands for Working with Laravel

April 27, 2025April 30, 2025 by Jabal TorresPosted in UncategorizedTags: DDEV

🚀 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)

  • Share on facebook
  • Share on twitter
  • Share on linkedin

Latest Posts

  • KrateCMS: A Developer-Friendly CMS with Laravel 11
  • Managing Multiple .env Files in Laravel for Local, Staging, and Production Environments
  • Common DDEV Commands for Working with Laravel
  • DDEV MySQL Guide
  • Streamlining Your Codebase: A Step-by-Step Guide to Effective Refactoring
  • Common Git Message Prefixes
  • Crafting Clear Commit Messages: Best Practices for Effective Version Control
Posted in UncategorizedTags: DDEV

Post navigation

Previous: DDEV MySQL Guide
Next: Managing Multiple .env Files in Laravel for Local, Staging, and Production Environments

Copyright © 2025. 916 Marketing. All rights reserved.

  • About
  • Services
  • Work
  • Blog
  • Contact Us