-
Notifications
You must be signed in to change notification settings - Fork 0
CLI Commands
BOUNDLY is driven by Artisan CLI commands that cover the full lifecycle of development and production.
Starts the development server and automatically synchronizes the database on entity changes. This is your primary development tool.
-
{--lang=en}- Set the CLI output language (enores). -
{--port=8000}- Set the port for the development server.
-
Initial Sync — Scans
Domain/andApplication/immediately on startup. -
Auto DB Sync — Monitors for file changes. If you modify an
#[Entity],core:migrateis called automatically. -
Rest Server — Launches the API at
http://127.0.0.1:8000.
php artisan core:watch --lang=esThe safe schema evolution engine. Scans your entities and translates attributes into SQL DDL commands. Zero migration files needed.
-
{--lang=en}— Set the CLI output language. -
{--dry-run}— Preview what would change without touching the database.
- Fingerprinting — Hashes each entity's schema. If unchanged, it is skipped entirely (idempotent).
-
History Tracking — Records every applied change in the
boundly_migrationstable. - Non-Destructive — Never drops columns or tables automatically. Human approval required for destructive ops.
- Smart Evolution — Adds new columns, audit fields, soft-delete columns, and FK columns as needed.
-
Column Type Mapping — Automatically maps
bigintto Laravel'sbigIntegerfor proper Blueprint support. -
Audit Column Handling — When using
#[Column]forcreated_byorupdated_by, the framework skips auto-adding them via#[Auditable]to prevent duplicates.
The framework automatically maps column type aliases to Laravel Blueprint methods:
| Attribute Type | Laravel Method |
|---|---|
bigint |
bigInteger() |
bigintunsigned |
bigInteger() |
# Preview changes without applying them
php artisan core:migrate --dry-run
# Apply changes
php artisan core:migrateCaches the entire entity/action metadata registry into a static PHP file (bootstrap/cache/boundly.php). Required before deploying to production.
-
{--clear}— Deletes the cache file (run after Domain/Application changes in development).
- In production (when the cache file exists), the framework reads from a fast
requirecall — no filesystem scanning, no reflection. - In local/development (cache disabled via
BOUNDLY_DISABLE_CACHE=true), the engine scans and reflects on every request.
# Build cache (before deploy)
php artisan core:cache
# Clear cache (during development)
php artisan core:cache --clearAuto-generates a full OpenAPI 3.0 (Swagger) specification from your Entity metadata. Zero documentation effort.
-
{--format=json}— Output format (jsonoryaml). -
{--out=}— Custom output file path (default:storage/app/openapi.json).
- All CRUD paths (
GET,POST,PUT,PATCH,DELETE) per resource. - Full JSON Schema per entity (types, max lengths, nullable, required).
- Pagination metadata structure.
php artisan core:docs
# → Open storage/app/openapi.json in https://editor.swagger.ioAuto-generates a Pure Domain Entity pre-configured for BOUNDLY. This command enforces the correct DDD structure and eliminates boilerplate.
-
{name}— The singular name of the Entity (e.g.,Product,Invoice). -
{--a|auditable}— Automatically import and apply the#[Auditable]attribute. -
{--s|soft-delete}— Automatically import and apply the#[SoftDelete]attribute.
- Automatically resolves the pluralized Domain directory (e.g.,
Domain/Products/Entities/). - Outputs a ready-to-use PHP Entity with
#[Entity],#[Id],#[Column], and theAggregateRoottrait.
# Generate a simple entity
php artisan core:make:entity Invoice
# Generate an entity with audit and soft-delete features
php artisan core:make:entity Order --auditable --soft-deleteAuto-generates smart API test stubs for your Domain Entities.
-
{resource?}— (Optional) The specific entity resource or table to generate tests for. If omitted, it generates tests for all entities.
- Parses the entity's
#[Column]types and limits to generate a valid mock payload (e.g., inserts a valid email if the column is named 'email', injects an integer if it's an integer column). - Creates a PHPUnit class inside
Domain/{YourDomain}/Tests/{Entity}ApiTest.phpto enforce DDD organization.
# Generate tests for all entities
php artisan core:make:test
# Generate tests only for users
php artisan core:make:test users| Flag | Language |
|---|---|
--lang=en |
English (Default) |
--lang=es |
Spanish |
You can also set the permanent language in config/boundly.php via BOUNDLY_LOCALE.
# 1. Preview schema changes
php artisan core:migrate --dry-run
# 2. Apply schema changes
php artisan core:migrate
# 3. Cache metadata for production performance
php artisan core:cache
# 4. Generate up-to-date API documentation
php artisan core:docsNext Step: Configuration ⚙️