<p>Then you notice it created a service class in a project that uses actions. It added a resource controller where every other controller is invokable. It put the model in <code>app/</code> instead of <code>app/Models/</code>. It forgot the policy. It used PHPUnit assertions in a Pest project.</p><p>The agent wrote valid Laravel. It just didn't write <em>your</em> Laravel.</p><h2>The problem is context, not capability</h2><p>When you ask an agent to add a comments feature, it needs to answer a dozen questions before writing anything:</p><ul><li><p>What relationships does <code>Post</code> already have?</p></li><li><p>Does the project use actions, services, or fat controllers?</p></li><li><p>Are controllers invokable or resource-style?</p></li><li><p>Is auth handled by Sanctum, Passport, or Fortify?</p></li><li><p>Does the project use Pest or PHPUnit?</p></li><li><p>Are there factories for the existing models?</p></li><li><p>What middleware pattern do the routes follow?</p></li></ul><p>Without these answers, the agent guesses. Sometimes it guesses right. Often it doesn't, and you spend the next twenty minutes fixing conventions instead of building features.</p><h2>Three tools that replace guessing with knowing</h2><p><code>@elyracode/laravel</code> gives the agent x-ray vision into your project. Three tools, each answering a different question: what's the data model, what's the API surface, and what are the conventions.</p><pre><code class="language-bash">elyra install npm:@elyracode/laravel
</code></pre><p>The extension activates automatically when it detects <code>laravel/framework</code> in your <code>composer.json</code>. Non-Laravel projects never see the tools.</p><h3><code>laravel_models</code> — the entire data model in one call</h3><p>Instead of reading twenty model files to understand the relationships:</p><pre><code>23 Eloquent models found:

User (app/Models/User.php)
  hasMany: Post (via posts())
  hasMany: Comment (via comments())
  hasMany: Order (via orders())
  belongsToMany: Role (via roles())
  belongsToMany: Team (via teams())
  hasOne: Profile (via profile())
  fillable: name, email, password
  casts: email_verified_at (datetime), password (hashed)
  scopes: active, verified, admin
  traits: HasFactory, Notifiable, SoftDeletes

Post (app/Models/Post.php)
  belongsTo: User (via user())
  belongsTo: Category (via category())
  hasMany: Comment (via comments())
  belongsToMany: Tag (via tags())
  fillable: title, body, slug, published_at, category_id, user_id
  casts: published_at (datetime), metadata (array)
  scopes: published, draft
  traits: HasFactory, HasSlug, SoftDeletes

Order (app/Models/Order.php)
  belongsTo: User (via user())
  hasMany: OrderItem (via items())
  morphMany: Payment (via payments())
  fillable: user_id, status, total, currency
  casts: total (decimal:2), status (OrderStatus)
  traits: HasFactory
</code></pre><p>The agent sees every relationship, every cast, every scope, every trait. When it needs to add a <code>Comment</code> model, it already knows that <code>Post</code> has a <code>comments()</code> relationship, that the project uses <code>HasSlug</code> as a trait, and that <code>SoftDeletes</code> is the convention.</p><p>One tool call. Zero file reads. The data model that would have cost 15,000 tokens to discover by reading files costs 800.</p><h3><code>laravel_routes</code> — the full request lifecycle</h3><pre><code>47 routes:

GET /api/posts
  name: posts.index
  action: App\Http\Controllers\PostController@index
  middleware: api, auth:sanctum

POST /api/posts
  name: posts.store
  action: App\Http\Controllers\PostController@store
  middleware: api, auth:sanctum

GET /api/posts/{post}
  name: posts.show
  action: App\Http\Controllers\PostController@show
  middleware: api, auth:sanctum

DELETE /api/posts/{post}
  name: posts.destroy
  action: App\Http\Controllers\PostController@destroy
  middleware: api, auth:sanctum, can:delete,post
</code></pre><p>Not just routes — middleware chains, controller bindings, named routes. The agent sees that <code>auth:sanctum</code> is the standard, that delete routes use policy authorization via <code>can:delete,post</code>, and that the naming convention is <code>resource.action</code>.</p><p>Filter by prefix to focus on what matters:</p><pre><code>Show me the admin routes
→ laravel_routes(prefix: "admin")
</code></pre><h3><code>laravel_analyze</code> — the architecture at a glance</h3><pre><code>Stack: Laravel v13.1.0 + Livewire + Tailwind + Alpine.js
Auth: Sanctum
Queue: redis
Cache: redis
Database: mysql
Patterns: Action classes (app/Actions/), Enums (app/Enums/), Events (app/Events/), Jobs (app/Jobs/)
Controllers: primarily invokable (single-action)
Models: 23
Migrations: 47
Factories: 19
Missing factories: Payment, AuditLog, Setting, Notification
Tests: 142 files (Pest)
Pending migrations: 2
</code></pre><p>The agent now knows: this project uses actions, not services. Controllers are invokable. Tests use Pest. Four models are missing factories. Two migrations haven't been run yet.</p><p>When you ask "add a comments feature," the agent generates:</p><ul><li><p>A migration (following the existing naming conventions)</p></li><li><p>A <code>Comment</code> model with the right relationships and a factory</p></li><li><p>A <code>CreateComment</code> action (not a service, not a fat controller — because that's what the project uses)</p></li><li><p>A <code>StoreCommentRequest</code> for validation</p></li><li><p>An invokable <code>StoreCommentController</code> (not a resource controller)</p></li><li><p>Routes with <code>auth:sanctum</code> middleware</p></li><li><p>A <code>CommentPolicy</code></p></li><li><p>A Pest test file</p></li></ul><p>Every piece matches the project's conventions. Not because the agent is smart about Laravel — because it looked first.</p><h2>A complete Laravel toolkit</h2><p><code>@elyracode/laravel</code> joins a family of Laravel-specific extensions that each handle a different part of the stack:</p><p><strong>Extension What it does </strong></p><ul><li><p><code>@elyracode/laravel</code> <strong>Project understanding</strong> — models, routes, architecture analysis </p></li><li><p><code>@elyracode/stack-tall</code> <strong>TALL stack</strong> knowledge — Livewire 4, Flux UI, Alpine.js, Tailwind </p></li><li><p><code>@elyracode/stack-vilt</code> <strong>VILT stack</strong> knowledge — Vue 3, Inertia.js, Laravel, Tailwind </p></li><li><p><code>@elyracode/stack-rilt</code> <strong>RILT stack</strong> knowledge — React 19, Inertia.js 2, Laravel, shadcn/ui </p></li><li><p><code>@elyracode/stack-filament</code> <strong>Filament v5</strong> — admin panels, CRUD, tables, forms </p></li><li><p><code>@elyracode/stack-laravel-ai</code> <strong>Laravel AI SDK</strong> — agents, sub-agents, embeddings </p></li><li><p><code>@elyracode/laravel-starters</code> <strong>Starter kits</strong> from GitHub for bootstrapping projects </p></li><li><p><code>@elyracode/flux-ui</code> <strong>Flux UI</strong> — component index, Blade converter, page generation </p></li><li><p><code>@elyracode/herd</code> <strong>Laravel Herd</strong> — services, logs, PHP version, .env sync </p></li><li><p><code>@elyracode/db-tools</code> <strong>Database</strong> — MySQL, ClickHouse, SQLite, schema discovery</p></li></ul><p>Install the ones that match your stack. They all work together — the <code>laravel</code> extension understands your architecture, and the stack extensions give the agent deep knowledge of your specific tools.</p><p>For a TALL stack project:</p><pre><code class="language-bash">elyra install npm:@elyracode/laravel
elyra install npm:@elyracode/stack-tall
elyra install npm:@elyracode/flux-ui
</code></pre><p>The agent now understands your data model (via <code>laravel</code>), knows Livewire 4 component patterns (via <code>stack-tall</code>), and can generate Flux UI components (via <code>flux-ui</code>). Ask it to "add a comments section to the post page" and it generates a Livewire component with Flux UI markup that matches both your data model and your frontend stack.</p><h2>The difference in practice</h2><p>Here's a real task: "Add user notifications with email and database channels."</p><p><strong>Without </strong><code>@elyracode/laravel</code> — typical agent behavior:</p><p>The agent reads <code>User.php</code> to check for existing notification traits. Reads three controller files to understand the pattern. Reads <code>routes/api.php</code>. Reads two existing notification classes to understand the format. Makes assumptions about the queue driver. Generates a notification with PHPUnit tests (the project uses Pest). Uses a service class (the project uses actions). Puts the controller in the wrong namespace.</p><p>Token cost: ~18,000. Three things need manual fixing.</p><p><strong>With </strong><code>@elyracode/laravel</code><strong>:</strong></p><p>The agent calls <code>laravel_analyze()</code> — sees Actions pattern, Pest tests, redis queue, Sanctum auth. Calls <code>laravel_models(filter: "User")</code> — sees existing traits, relationships, and that <code>Notifiable</code> is already there. Generates: migration, <code>DatabaseNotification</code> model, <code>SendUserNotification</code> action, <code>NotificationController</code> (invokable), routes with correct middleware, Pest tests.</p><p>Token cost: ~5,000. Nothing needs fixing.</p><h2>Get it</h2><pre><code class="language-bash">elyra update
elyra install npm:@elyracode/laravel
</code></pre><p>Then ask: <em>"analyze this project"</em> or <em>"show me the models."</em> The agent does the rest.</p><hr><p><em>Elyra v0.7.12 — </em><a target="_blank" rel="noopener noreferrer nofollow" href="https://elyracode.com/changelog"><em>changelog</em></a></p>