Skip to content

Commands & Settings Reference ​

Commands ​

All commands live under the Laravel API Generator category in the command palette (Ctrl+Shift+P). Most are also reachable from the sidebar toolbar and … menu.

CommandDescription
Generate Full APIOpen the Entity Builder panel
Generate APIs from DatabaseEvery table at once, picked in a multi-select, then the review screen
Generate APIs from Schema FileGenerate from api-schema.yaml / .yml / .json, after the review screen
Generate APIs from Mermaid DiagramGenerate from a .mmd file, after the review screen
Generate APIs from OpenAPI SpecGenerate from an OpenAPI or Swagger file, JSON or YAML, after the review screen
Describe an API with CopilotOpen the Copilot panel: describe the API, adjust the proposed entities, then review the plan
Add Fields to Entity…Evolve an entity via --add-fields
Regenerate File(s)…Rebuild selected artifacts via --only=, after the review screen
Delete Full APIRemove an entity's files, routes and seeder registration
Show Entity DiagramOpen the interactive canvas
Show SnippetsList the bundled PHP snippets
Go to Related FileJump between an entity's generated files
Refresh EntitiesRe-scan the project for generated entities
Project ActionsMigrations, tests, seeding, API docs and stubs, run in a panel with their result

Keybindings ​

KeysCommand
Ctrl+Alt+R (Cmd+Alt+R on macOS)Go to Related File

Settings ​

SettingDefaultDescription
laravelApiGenerator.phpPathphpPath to the PHP executable
laravelApiGenerator.phpCommand[]Full command that runs PHP, one argument per item (Sail, Docker). Wins over phpPath when set.
laravelApiGenerator.mcp.enabledtrueOffer the package's MCP server to Copilot's agent mode when the project has laravel/mcp
laravelApiGenerator.localeautoUI language: auto (follow VS Code), en or fr

PHP snippets ​

Type a lag: prefix in any PHP file:

PrefixExpands to
lag:serviceA full service class (getAll with filtering, create, find, update, delete)
lag:controllerA CRUD controller with service injection
lag:dtoA readonly DTO class with fromRequest()
lag:requestA FormRequest with authorize() and rules()
lag:resourceAn API resource toArray() method
lag:factoryA factory definition() method
lag:test-featureA feature test method skeleton
lag:test-unitA service unit test method skeleton
lag:routeRoute::apiResource(…)
lag:filterA scopeFilter() query scope

Copilot and schema files ​

In a Laravel project, the extension gives GitHub Copilot (VS Code 1.109 and later) the package's laravel-api-generator agent skill. Copilot loads it when a task calls for new API resources or CRUD endpoints, and generates them with make:fullapi instead of writing the files by hand.

When the project also has laravel/mcp, the extension registers the package's MCP server (VS Code 1.101 and later). Copilot's agent mode then lists a Laravel API Generator server whose tools list your entities, preview a generation, generate APIs and add fields, and never overwrite a file you edited. The server starts with the PHP command of the settings above, so Sail and Docker work too, and it appears or disappears on its own when you install or remove laravel/mcp. It also shows up in the Extensions view, under MCP Servers - Installed.

The package's MCP server in VS Code, started with php artisan api-generator:mcp

api-schema.yaml, api-schema.yml and api-schema.json are checked against the package's JSON Schema: keys and types complete as you type, and typos show up as problems. YAML files need the Red Hat YAML extension; JSON works out of the box.

Activation ​

The extension activates when the workspace contains an artisan file: including monorepos where the Laravel app lives up to two levels deep (backend/, apps/api/…).

Changelog ​

Extension releases are listed on the Changelog page.