Artisan Commands
The starter includes several custom Artisan commands for managing your application’s database, configuration, and Northwestern integrations.
Database Commands
Section titled “Database Commands”db:rebuild
Section titled “db:rebuild”Completely rebuild the database by dropping all tables, running migrations, and executing all auto-discovered seeders.
php artisan db:rebuildWhat it does:
- Drops all tables, views, and types
- Runs all migrations
- Executes all seeders marked with
#[AutoSeed]attribute - Regenerates IDE helper files
When to use:
- Initial project setup
- After pulling schema changes from git
- When switching between feature branches with different schemas
- Resetting test data during development
Related: db:wipe, migrate:fresh, db:seed
db:seed:list
Section titled “db:seed:list”Display all auto-discovered seeders with their dependencies and execution order.
php artisan db:seed:listOutput example:
┌───┬──────────────────┬──────────────────────────────────┐ │ # │ Seeder │ Dependencies │ ├───┼──────────────────┼──────────────────────────────────┤ │ 1 │ PermissionSeeder │ none │ │ 2 │ RoleTypeSeeder │ none │ │ 3 │ RoleSeeder │ RoleTypeSeeder, PermissionSeeder │ └───┴──────────────────┴──────────────────────────────────┘When to use:
- Verify seeder discovery and dependencies
- Troubleshoot seeding order issues
- Document available seeders for your team
See also: Idempotent Seeding documentation
db:snapshot:create {name}
Section titled “db:snapshot:create {name}”Create a snapshot of the current database state.
php artisan db:snapshot:create my-snapshot-nameOptions:
{name}- (optional) Descriptive name for the snapshot. Defaults todatabase-dumpif omitted.--skip-schema-validation- Skip schema validation checks
What it does:
- Validates database schema matches current migrations (unless skipped)
- Dumps database to
database/snapshots/{name}.sql - Stores metadata about the snapshot (checksum, timestamp, migration/seeder counts)
When to use:
- Before making risky database changes
- Saving a known-good state for testing
- Creating test data fixtures
- Preserving demo data
See also: Database Snapshots documentation
db:snapshot:restore {name}
Section titled “db:snapshot:restore {name}”Restore a previously created database snapshot.
php artisan db:snapshot:restore my-snapshot-nameOptions:
{name}- (optional) Name of the snapshot to restore. Defaults todatabase-dumpif omitted.--skip-schema-validation- Skip schema validation checks--backup- Create a backup of the current database before restoring
What it does:
- Validates snapshot exists
- Checks schema compatibility (unless skipped)
- Creates a backup if requested
- Drops all current database tables
- Restores data from snapshot SQL file
When to use:
- Resetting to a known state during testing
- Recovering from bad data changes during development
- Switching between test scenarios
db:snapshot:list
Section titled “db:snapshot:list”List all available database snapshots.
php artisan db:snapshot:listdb:snapshot:info {name}
Section titled “db:snapshot:info {name}”Display detailed information about a specific snapshot.
php artisan db:snapshot:info my-snapshot-nameOptions:
{name}- (optional) Name of the snapshot to inspect. If omitted, an interactive selector is shown.
What it does:
- Displays file information (path, size, modification date)
- Shows schema metadata (checksum, migration/seeder counts)
- Compares snapshot schema with current codebase
When to use:
- Verifying a snapshot’s contents before restoring
- Checking if a snapshot is compatible with current code
- Reviewing snapshot metadata
db:snapshot:delete {name}
Section titled “db:snapshot:delete {name}”Delete a database snapshot and its associated metadata.
php artisan db:snapshot:delete my-snapshot-nameOptions:
{name}- (optional) Name of the snapshot to delete. If omitted, an interactive selector is shown.--all- Delete all snapshots
What it does:
- Removes the SQL snapshot file from
database/snapshots/ - Cleans up associated metadata from the checksum map
When to use:
- Removing old or unused snapshots
- Freeing up disk space
- Cleaning up after testing
db:wake
Section titled “db:wake”Wake up a potentially-inactive serverless RDS database by establishing a connection.
php artisan db:wakeWhat it does:
Attempts to connect to the database and execute a simple query, causing serverless databases (like AWS Aurora Serverless) to wake from sleep mode.
When to use:
- Before running migrations
- As part of deployment scripts
- When you know the database has been idle
Configuration Commands
Section titled “Configuration Commands”config:validate
Section titled “config:validate”Validate application configuration and environment variables.
php artisan config:validateWhat it does:
Checks that all required environment variables are set and configuration is valid:
- Northwestern API credentials (Directory Search, WebSSO, EventHub)
- Database connection details
- S3/MinIO configuration
- Required app settings
When to use:
- After initial installation
- After environment variable changes
- Before deployment
- Troubleshooting integration issues
Maintenance Commands
Section titled “Maintenance Commands”access-tokens:notify-expiration
Section titled “access-tokens:notify-expiration”Send expiration reminder emails for access tokens approaching their expiration date.
php artisan access-tokens:notify-expirationWhat it does:
- Queries for active access tokens with upcoming expiration dates
- Checks which tokens are due for notifications (30, 14, 7, 3, 1 days before)
- Sends reminder emails to token owners
See also: API Documentation
Health Check Commands
Section titled “Health Check Commands”health:check
Section titled “health:check”Run health checks for all external integrations and services.
php artisan health:checkWhat it does:
Validates connectivity and configuration for:
- Database - Connection and query execution
- S3/MinIO - Bucket access and write permissions
- Directory Search API - API connectivity and test query
- WebSSO/Entra ID - Authentication endpoint availability
- EventHub - API endpoint accessibility (if configured)
When to use:
- After deployment
- Troubleshooting integration issues
- Monitoring service connectivity
- As part of CI/CD pipelines
Integration:
The /api/health endpoint also runs these checks for automated monitoring:
curl https://your-app.northwestern.edu/api/healthIDE Helper Commands
Section titled “IDE Helper Commands”The starter uses laravel-ide-helper to generate IDE autocomplete files. These commands are automatically run after db:rebuild:
ide-helper:generate
Section titled “ide-helper:generate”Generate IDE helper file for Laravel facades.
php artisan ide-helper:generateide-helper:models
Section titled “ide-helper:models”Generate PHPDoc annotations for Eloquent models.
php artisan ide-helper:models --write --resetide-helper:meta
Section titled “ide-helper:meta”Generate PhpStorm meta file for container bindings.
php artisan ide-helper:meta