evertap
Frameworks

Laravel

Use an evertap PostgreSQL or MySQL database with Laravel, with DB_URL in .env, migrations, and tests on a database of their own, parallel ones included.

Each evertap database runs on a PostgreSQL or MySQL instance of its own, and the user in its URL can create and drop databases there. Parallel testing creates a database for each process as it does on a database you run yourself.

Create the database

evertap create postgres myapp     # or: evertap create mysql myapp
evertap url myapp                 # prints the URL

Laravel reads the URL from DB_URL, not DATABASE_URL. In .env, set the connection and the URL:

DB_CONNECTION=pgsql     # mysql for MySQL
DB_URL=postgres://evertap_k3x9q2m7v1ab:…@ev.internal:5432/evertap_k3x9q2m7v1ab

The URL wins over DB_HOST, DB_DATABASE, and the rest, so those can stay.

On a laptop that reaches evertap on another machine, keep evertap connect running while you work (Connect from your laptop).

Migrate

php artisan migrate

Tests

A new Laravel app's phpunit.xml runs tests on SQLite in memory. To run them on evertap, remove these lines from it:

<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="DB_URL" value=""/>

Laravel does not create a database that only DB_URL names, so create a second database for tests:

evertap create postgres myapp-test     # or: evertap create mysql myapp-test

Copy .env to .env.testing, which tests read instead, and set its DB_URL to the URL evertap url myapp-test prints. Then run the tests:

php artisan test

php artisan test --parallel needs ParaTest: composer require brianium/paratest --dev. It creates a database for each process next to the test database and keeps them for the next run; --recreate-databases starts them over.

Good to know

  • php artisan schema:dump runs pg_dump on your computer, and pg_dump refuses a database of a newer major version than itself. Install the client of your database's version, PostgreSQL 18 unless you picked another, or create the database with --version to match your client.
  • On MySQL, schema:dump runs mysqldump, and migrate loads the dump with mysql. MariaDB's versions of both, 11.4 and later, such as on Debian 13, check the certificate of evertap's MySQL entry, which is self-signed, and stop (MySQL).
  • evertap does not offer PostgreSQL's own TLS. Keep DB_SSLMODE at its default, prefer, or set it to disable; require fails.
Edit on GitHub

The evertap name and logo are not licensed with the code (section 6 of the license). You may use them to refer to evertap, but not to name or brand your own product or service, or in a way that suggests evertap made or endorses it, without permission.

evertap is an independent project. It is not affiliated with, endorsed, sponsored, supported, or certified by the owners of the software it runs, and it uses their names only to say which software that is.

  • Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada, and used with their permission.
  • MySQL is a registered trademark of Oracle and/or its affiliates.
  • Redis is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd.
  • Other names, including Garage and Cloudflare, may be trademarks of their respective owners.

On this page