VS Code Extension
A free visual interface for the generator: build entities in a form, preview the generated code live, and drive the whole API lifecycle without touching the terminal.
Install from the Marketplace · Extension repository
What it adds
| Entity Builder | A form with live code preview instead of CLI flags: fields, enums, relations, options |
| Imports | Generate from your database, a schema file, a Mermaid diagram, a JSON definition or an OpenAPI / Swagger spec |
| Diagram & Sidebar | An interactive entity canvas and a tree of everything you generated |
| Quick Actions & Guardrails | Migrate, seed, tests, routes and API docs in one click, server and dependencies handled for you |
| Commands & Settings | Command palette reference, keybindings, settings, PHP snippets |
The whole UI (panel labels, popups, prompts, error messages) is available in English and French, following VS Code's display language (forceable via the laravelApiGenerator.locale setting).
Install
- Search "Laravel API Generator" in VS Code Extensions (
Ctrl+Shift+X), or install from the Marketplace. - Open a Laravel project: the extension activates when it finds an
artisanfile (monorepos are supported: Laravel apps up to two levels below the workspace root, e.g.backend/orapps/api/, are detected). - The extension drives the Composer package in your project:
composer require --dev nameless/laravel-api-generatorIf the package is missing, the extension offers to install it for you, as a dev dependency (nothing from the generator ships to production, and the generated code doesn't depend on it). If the installed version is too old for a feature, it explains why and offers to run composer update.
A native Getting Started walkthrough (Help → Get Started) covers the package install, your first generation, database import and the sidebar.
Requirements
- VS Code 1.80+
- PHP 8.2+ on your PATH (or set
laravelApiGenerator.phpPath) - A Laravel 10 / 11 / 12 / 13 project
Your first API, without a terminal
- Click the Laravel API Generator icon in the activity bar.
- Pick a Quick Start preset (Blog Post, Product…), fill the form, or import from your database or a spec.
- Watch the live preview update as you type, then click Generate API. The new Model and Controller open in the editor.
- Click Run Migrations (if
.envis missing, the extension offers to create it from.env.example), then Fresh + Seed if you want sample data. - Click Open API Docs: the extension starts the server if none is running and opens the interactive documentation of your new API in the browser.
The full tour of the buttons is on the Quick Actions page.
