This template provides a basic Laravel skeleton. It comes pre-configured to use a MariaDB database and Redis for caching and sessions using a Laravel-specific bridge library that runs during Composer autoload. The public files symlink is also replaced with a custom web path definition so it is unnecessary. It is intended for you to use as a starting point and modify for your own needs.
Laravel is an opinionated, integrated rapid-application-development framework for PHP.
On Platform.sh the minimum time between cron jobs being triggered depends on your plan. Laravel documentation suggests running the scheduler as a cron job every minute. Task scheduling may then be contradicted by the cron minimum frequency. Schedules outside the specified cron frequency are ignored and the related tasks aren’t triggered.
Due to this conflict, this Laravel template utilizes workers to run both the scheduler and the queue systems. In order to have enough resources to support these workers as well as the MariaDB and Redis service, this template requires at least a Medium plan.
The following changes have been made relative to a plain Laravel project. If using this project as a reference for your own existing project, replicate the changes below to your project.
.platform.app.yaml
, .platform/services.yaml
, and .platform/routes.yaml
files have been added. These provide Platform.sh-specific configuration and are present in all projects on Platform.sh. You may customize them as you see fit.platformsh/laravel-bridge
, has been added. It automatically maps Platform.sh's environment variables to Laravel's environment variables where possible. It leverages the platformsh/config-reader
library.rediscache
and redissession
relationships in .platform.app.yaml
.artisan storage:link
command. That is not necessary and will not work on Platform.sh due to the read-only file system. Instead, a dedicated web path mapping is included for the /storage
path that has the same effect.