Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AlexanderDamont1/Stratus/llms.txt

Use this file to discover all available pages before exploring further.

Stratus supports MySQL, PostgreSQL, and SQLite. The default connection is MySQL. SQLite is a zero-configuration option suitable for local development and testing. MySQL or PostgreSQL are recommended for production.

Choosing a database

Create a MySQL database, then add the connection details to .env:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=stratus
DB_USERNAME=root
DB_PASSWORD=
Then run migrations:
php artisan migrate

Running migrations

Migrations create and update the database schema. Run them after configuring your database connection:
php artisan migrate
To check migration status:
php artisan migrate:status

Database tables

The default migrations create the following tables:
TableMigration filePurpose
users0001_01_01_000000User accounts and authentication data.
password_reset_tokens0001_01_01_000000Tokens for the password reset flow.
sessions0001_01_01_000000Database-backed session storage.
cache0001_01_01_000001Key-value cache store.
cache_locks0001_01_01_000001Distributed cache lock management.
jobs0001_01_01_000002Pending queue jobs.
job_batches0001_01_01_000002Metadata for batched queue jobs.
failed_jobs0001_01_01_000002Jobs that failed after all retry attempts.

Resetting the database

migrate:fresh drops all tables and re-runs every migration from scratch. All data will be permanently destroyed. Never run this on a production database.
To reset the database during development:
php artisan migrate:fresh
To reset and re-seed with test data:
php artisan migrate:fresh --seed

Local development with Laravel Sail

Laravel Sail provides a Docker-based local environment with MySQL (or PostgreSQL) and other services configured out of the box. It is included as a dev dependency.
1

Start Sail

./vendor/bin/sail up -d
This starts MySQL, Redis, Mailpit, and the PHP application container.
2

Update .env for Sail

Sail sets the database host to the service name defined in docker-compose.yml. Update .env:
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=stratus
DB_USERNAME=sail
DB_PASSWORD=password
3

Run migrations inside the container

./vendor/bin/sail artisan migrate
Run ./vendor/bin/sail artisan instead of php artisan to execute Artisan commands inside the Sail container.

Advanced options

If you have an existing Stratus database (for example, when deploying to a new server), set the correct credentials in .env and run:
php artisan migrate
Laravel will only run migrations that have not been recorded in the migrations table, leaving existing data untouched.
DB_CONNECTION sets the default connection. The full set of connection options for each driver is defined in config/database.php. You can define multiple connections there and reference them explicitly in model definitions or query builder calls.
For fast test runs, configure phpunit.xml to use an in-memory SQLite database:
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
Tests that use RefreshDatabase or DatabaseMigrations will run against the in-memory database and leave no files on disk.