Runway
Runway is built and operated in the EU!

Laravel

The following example describes the necessary steps to deploy a Laravel application.

If you would like to skip the project setup, head over to our Github repository to find the complete source code and follow deployment instructions below.

Project setup

$ composer create-project laravel/laravel example-laravel-app
Creating a "laravel/laravel" project at "./example-laravel-app"
Info from https://repo.packagist.org: #StandWithUkraine
Installing laravel/laravel (v9.3.6)
  - Installing laravel/laravel (v9.3.6): Extracting archive
Created project in /Users/till/Documents/workspaces/hostwithquantum/example-laravel-app
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies
Lock file operations: 105 installs, 0 updates, 0 removals
  - Locking brick/math (0.10.2)
  - Locking dflydev/dot-access-data (v3.0.1)
  - Locking doctrine/inflector (2.0.4)
  - Locking doctrine/instantiator (1.4.1)
  - Locking doctrine/lexer (1.2.3)
  - Locking dragonmantank/cron-expression (v3.3.1)
  - Locking egulias/email-validator (3.2.1)
  - Locking fakerphp/faker (v1.20.0)
  - Locking filp/whoops (2.14.5)

For Laravel to work, it requires the OpenSSL PHP extension.

Unfortunately, this extension is missing in composer.json but we can add it ourselves and this serves as a good example how to add all the dependencies of your application so our build service assembles everything you need.

$ composer require ext-openssl
Using version * for ext-openssl
Info from https://repo.packagist.org: #StandWithUkraine
./composer.json has been updated
Running composer update ext-openssl
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating optimized autoload files
...

OpenSSL

In order to make it work, or for example to load non-standard extension, here is how.

The buildpack process adds a directory .php.ini.d which is inside your project to the PHP_INI_SCAN_DIR. Use that to add additional PHP configuration, such as loading other extensions.

$ mkdir .php.ini.d/
$ echo "extension=openssl.so" >> .php.ini.d/custom.ini

Deployment

Create an application:

$ runway app create
INFO    created app "comfortable-planet"             
create app comfortable-planet: done
next steps:  
* commit your changes  
* runway app deploy  
* runway open

Configure it:

$ cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
9i8ttROYLyfXrDJTkRrAqkYnMmtg3gJi

… and add the APP_KEY along with APP_DEBUG, LOG_CHANNEL:

$ runway app config set \
  APP_KEY=9i8ttROYLyfXrDJTkRrAqkYnMmtg3gJi \
  APP_DEBUG=true \
  LOG_CHANNEL=stderr
INFO    configuring app "comfortable-planet"         
configure app comfortable-planet: done
Name        Value                            
APP_KEY     9i8ttROYLyfXrDJTkRrAqkYnMmtg3gJi 
APP_DEBUG   true                             
LOG_CHANNEL stderr

Deploy

runway app deploy