Skip to content

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 BuilderA form with live code preview instead of CLI flags: fields, enums, relations, options
ImportsGenerate from your database, a schema file, a Mermaid diagram, a JSON definition or an OpenAPI / Swagger spec
Diagram & SidebarAn interactive entity canvas and a tree of everything you generated
Quick Actions & GuardrailsMigrate, seed, tests, routes and API docs in one click, server and dependencies handled for you
Commands & SettingsCommand 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

  1. Search "Laravel API Generator" in VS Code Extensions (Ctrl+Shift+X), or install from the Marketplace.
  2. Open a Laravel project: the extension activates when it finds an artisan file (monorepos are supported: Laravel apps up to two levels below the workspace root, e.g. backend/ or apps/api/, are detected).
  3. The extension drives the Composer package in your project:
bash
composer require --dev nameless/laravel-api-generator

If 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

  1. Click the Laravel API Generator icon in the activity bar.
  2. Pick a Quick Start preset (Blog Post, Product…), fill the form, or import from your database or a spec.
  3. Watch the live preview update as you type, then click Generate API. The new Model and Controller open in the editor.
  4. Click Run Migrations (if .env is missing, the extension offers to create it from .env.example), then Fresh + Seed if you want sample data.
  5. 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.