This article appeared first on https://www.pascallandau.com/ at https://www.pascallandau.com/blog/run-laravel-9-docker-in-2022/ In this third subpart of the fourth part of this tutorial series on developing PHP on Docker we will install Laravel and make sure our setup works for Artisan Commands, a Redis Queue and Controllers for the front end requests.

The methods ensure that the tests are only executed if the proper database connection and queue driver is configured.

# File: config/database.php return [ //... 'connections' => [ //... 'testing' => [ 'driver' => 'mysql', 'host' => env('DB_HOST'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'testing'), 'username' => env('DB_USERNAME'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'prefix_indexes' => true, 'strict' => true, 'engine' => null, 'options' => extension_loaded('pdo_mysql')? array_filter([ ]) : [], ], ], //... 'redis' => [ //... 'testing' => [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD'), 'database' => env('REDIS_DB', '1000'), ], ], ]; # File: config/queue.php return [ //...
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners