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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners