Skip to main content

CLI Command Reference

All commands are invoked via the ./maple entry point in the project root.

Development server

CommandDescription
./maple serveStart the development server on localhost:8000
./maple serve --host=0.0.0.0 --port=8080Custom host and port

Code generation

CommandDescription
./maple make --type=controller --name=UserGenerate a controller class
./maple make --type=service --name=UserGenerate a service class
./maple make --type=migration --name=CreateUsersGenerate a migration class
./maple make --type=command --name=ImportGenerate a CLI command class

Or just run maple make and and follow the instructions.

Generated files are placed in the expected directory with the correct namespace pre-filled.

Migrations

CommandDescription
./maple migrateRun all pending migrations
./maple migrate:upStep one migration up
./maple migrate:downStep one migration down
./maple migrate:freshRoll all migrations down then back up
./maple migrate:clearRoll all migrations down
./maple migrate --name=CreateUsersRun one specific migration by name (always re-runs)

Custom commands

Custom commands are defined in app/Commands/ and registered in routes/console.php. See Writing Commands →.