Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
webminty-inertia-standards
webminty/boost-webminty-guidelines
claude-code
laravel
guidelines
boost
coding-standards
webminty

Apply Webminty's Inertia.js coding standards for any task that creates, edits, reviews, refactors, or formats Laravel controllers returning Inertia responses, HandleInertiaRequests middleware, shared data, or Inertia-specific testing patterns; covers the Laravel side of Inertia.js applications.

Install
php artisan boost:add-skill webminty/boost-webminty-guidelines

Save this content to: .claude/skills/webminty-inertia-standards/SKILL.md

# Webminty Inertia Guidelines

## Overview
Apply Webminty's Inertia guidelines for projects using Inertia.js as the frontend bridge. These standards cover the **Laravel side only**: controllers, middleware, shared data, redirects, form handling, and testing. Frontend framework conventions (React, Vue, Svelte) are out of scope.

## When to Activate
- Activate this skill when working on controllers that return `Inertia::render()` responses.
- Activate this skill when editing `HandleInertiaRequests` middleware or shared data.
- Activate this skill when writing tests that use `assertInertia()`.
- Activate this skill when creating or editing Inertia-related routes.

## Scope
- In scope: Inertia controllers, `Inertia::render()`, `HandleInertiaRequests` middleware, shared props, partial reloads and prop types (`Inertia::optional()`, `Inertia::defer()`, `Inertia::always()`, `Inertia::merge()`, `Inertia::once()`, `shareOnce()`), SSR configuration (Laravel side), Inertia redirects, Inertia testing with `assertInertia()`.
- Out of scope: Core PHP/Laravel standards (see `webminty-laravel-standards`), Tailwind CSS conventions (see `webminty-tailwind-standards`), frontend framework conventions (React, Vue, Svelte components, TypeScript, state management).

## Workflow
1. Identify the Inertia artifact (controller, middleware, shared data, route, test).
2. Read only the reference file(s) listed under References that match the task.
3. Apply `webminty-laravel-standards` first (PHP conventions, strict types), then Inertia-specific rules.

## Core Rules
- Controllers return `Inertia::render('PageName', [...props])`, never JSON. Keep API-only endpoints in separate API controllers.
- Page component names use PascalCase path notation: `Tickets/Show`, `Auth/Login`.
- Share common data (auth user, flash messages) via `HandleInertiaRequests::share()`. Don't share large datasets globally — use `Inertia::optional()` or page-specific props.
- Use `Inertia::optional()`, `Inertia::defer()`, `Inertia::always()`, `Inertia::merge()`, and `Inertia::once()` for controlling when props are loaded; use `Inertia::optional()` for expensive data that isn't always needed (frontend opts in via partial reload). (`Inertia::lazy()` was removed in v3.)
- Redirects use standard Laravel `redirect()->route()` / `redirect()->back()` after successful form submissions — Inertia handles them automatically.
- Use Form Requests for validation — Inertia handles 422 responses automatically.
- Delegate business logic to Actions, not controllers.

## Examples
```php
// Inertia controller
class ShowController extends Controller
{
    public function __invoke(Ticket $ticket): Response
    {
        return Inertia::render('Tickets/Show', [
            'ticket' => TicketsResource::make($ticket),
            'comments' => Inertia::optional(
                fn () => CommentResource::collection($ticket->comments),
            ),
        ]);
    }
}
```

```php
// Inertia test
test('can view ticket', function (): void {
    $user = User::factory()->create();
    $ticket = Ticket::factory()->create();

    $this->actingAs($user)
        ->get(route('tickets.show', $ticket))
        ->assertInertia(fn (Assert $page) => $page
            ->component('Tickets/Show')
            ->has('ticket')
        );
});
```

## References
Read only what the task needs, all under `references/`:
- `controllers-data.md` — Controllers, shared data, partial reloads
- `forms-routing.md` — Form handling, redirects, routes, directory structure, SSR
- `testing.md` — Inertia testing

Webminty Inertia Guidelines

Overview

Apply Webminty's Inertia guidelines for projects using Inertia.js as the frontend bridge. These standards cover the Laravel side only: controllers, middleware, shared data, redirects, form handling, and testing. Frontend framework conventions (React, Vue, Svelte) are out of scope.

When to Activate

  • Activate this skill when working on controllers that return Inertia::render() responses.
  • Activate this skill when editing HandleInertiaRequests middleware or shared data.
  • Activate this skill when writing tests that use assertInertia().
  • Activate this skill when creating or editing Inertia-related routes.

Scope

  • In scope: Inertia controllers, Inertia::render(), HandleInertiaRequests middleware, shared props, partial reloads and prop types (Inertia::optional(), Inertia::defer(), Inertia::always(), Inertia::merge(), Inertia::once(), shareOnce()), SSR configuration (Laravel side), Inertia redirects, Inertia testing with assertInertia().
  • Out of scope: Core PHP/Laravel standards (see webminty-laravel-standards), Tailwind CSS conventions (see webminty-tailwind-standards), frontend framework conventions (React, Vue, Svelte components, TypeScript, state management).

Workflow

  1. Identify the Inertia artifact (controller, middleware, shared data, route, test).
  2. Read only the reference file(s) listed under References that match the task.
  3. Apply webminty-laravel-standards first (PHP conventions, strict types), then Inertia-specific rules.

Core Rules

  • Controllers return Inertia::render('PageName', [...props]), never JSON. Keep API-only endpoints in separate API controllers.
  • Page component names use PascalCase path notation: Tickets/Show, Auth/Login.
  • Share common data (auth user, flash messages) via HandleInertiaRequests::share(). Don't share large datasets globally — use Inertia::optional() or page-specific props.
  • Use Inertia::optional(), Inertia::defer(), Inertia::always(), Inertia::merge(), and Inertia::once() for controlling when props are loaded; use Inertia::optional() for expensive data that isn't always needed (frontend opts in via partial reload). (Inertia::lazy() was removed in v3.)
  • Redirects use standard Laravel redirect()->route() / redirect()->back() after successful form submissions — Inertia handles them automatically.
  • Use Form Requests for validation — Inertia handles 422 responses automatically.
  • Delegate business logic to Actions, not controllers.

Examples

// Inertia controller
class ShowController extends Controller
{
    public function __invoke(Ticket $ticket): Response
    {
        return Inertia::render('Tickets/Show', [
            'ticket' => TicketsResource::make($ticket),
            'comments' => Inertia::optional(
                fn () => CommentResource::collection($ticket->comments),
            ),
        ]);
    }
}
// Inertia test
test('can view ticket', function (): void {
    $user = User::factory()->create();
    $ticket = Ticket::factory()->create();

    $this->actingAs($user)
        ->get(route('tickets.show', $ticket))
        ->assertInertia(fn (Assert $page) => $page
            ->component('Tickets/Show')
            ->has('ticket')
        );
});

References

Read only what the task needs, all under references/:

  • controllers-data.md — Controllers, shared data, partial reloads
  • forms-routing.md — Form handling, redirects, routes, directory structure, SSR
  • testing.md — Inertia testing
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib