laravel-inertia-react
БесплатноБез исполняемых скриптовНе проверенLaravel + Inertia.js + React integration patterns. Use when building Inertia page components, handling forms with useForm, managing shared data, or…
от AsyrafHussin★ 112 звёзд на GitHubОб этом скилле
Laravel + Inertia.js + React
Comprehensive patterns for building modern monolithic applications with Laravel, Inertia.js, and React. Contains 27 rules across 5 categories, written for Inertia v3.
When to Apply
Reference these guidelines when:
- Creating Inertia page components
- Handling forms with useForm hook
- Managing shared data and authentication
- Implementing persistent layouts
- Navigating between pages
Rule Categories by Priority
| Priority | Category | Impact | Prefix | Rules |
|---|---|---|---|---|
| 1 | Page Components | CRITICAL | page- |
7 |
| 2 | Forms & Validation | CRITICAL | form- |
9 |
| 3 | Navigation | HIGH | nav- |
6 |
| 4 | Shared Data | HIGH | shared- |
4 |
| 5 | Layouts | MEDIUM | layout- |
1 |
Quick Reference
1. Page Components (CRITICAL)
page-component-structure- Standard page component patternpage-props-typing- Type page props from Laravelpage-head-management- Title and meta tags with Headpage-default-layout- Assign layouts to pagespage-scroll-preservation- Keep scroll position across visitspage-partial-reloads- Reload only the props that changed,usePollpage-deferred-props-Inertia::defer()with<Deferred>
2. Forms & Validation (CRITICAL)
form-useform-basic- Basic useForm usageform-useform-hook- useForm methods and stateform-component-<Form>component for simple formsform-validation-errors- Display Laravel validation errorsform-file-uploads- File uploads with useFormform-progress-indicator- Upload and submit progressform-transform-data- Transform data before submitform-reset-handling- Reset fields and errorsform-dirty-tracking- Track and warn on unsaved changes
3. Navigation (HIGH)
nav-link-component- Use Link for navigationnav-programmatic- Navigate with the routernav-external-links- External links and downloadsnav-preserve-state- Preserve scroll and statenav-replace-history- Replace vs push historynav-usehttp-requests-useHttpfor JSON requests that are not page visits
4. Shared Data (HIGH)
shared-auth-user- Access authenticated usershared-flash-messages- Handle flash messagesshared-ziggy-routes- Named routes in JavaScript (Ziggy, or Wayfinder in starter-kit apps)shared-app-config- App configuration and feature flags
5. Layouts (MEDIUM)
layout-persistent- Persistent, nested and default layouts, layout props
Inertia v3 Notes
Check these when a project moves from Inertia v2 to v3 (see the v3 upgrade guide):
- Requires PHP 8.2+, Laravel 11+ and React 19.
- Axios is no longer shipped or required; Inertia has its own HTTP client. Use
useHttpfor non-visit requests.qsandlodash-esare no longer bundled: install them yourself if the app imports them. Inertia::lazy()andLazyPropare removed: useInertia::optional().router.cancel()is nowrouter.cancelAll().- The
invalidevent is nowhttpExceptionandexceptionis nownetworkError. hideProgress()/revealProgress()are removed: useprogress.hide()/progress.reveal()from@inertiajs/react.- The
inertiaattribute on head elements is nowdata-inertia. - The initial page data is always in a
<script type="application/json">element; thedata-pageattribute on the rootdivis gone. Delete thefutureblock fromcreateInertiaApp. - Arrow-function components assigned to
.layoutmust be wrapped in an array:Page.layout = [Layout]. <Deferred>keeps existing content during partial reloads; use itsreloadingslot prop.useFormprocessingandprogressreset only inonFinish.- Packages are ESM-only and target ES2022.
- Republish the config and clear views:
php artisan vendor:publish --provider="Inertia\\ServiceProvider" --forcethenphp artisan view:clear.
Essential Patterns
Page Component with TypeScript
// resources/js/Pages/Posts/Index.tsx
import { Head, Link } from '@inertiajs/react'
interface Post {
id: number
title: string
excerpt: string
created_at: string
author: {
id: number
name: string
}
}
interface Props {
posts: {
data: Post[]
links: { url: string | null; label: string; active: boolean }[]
}
filters: {
search?: string
}
}
export default function Index({ posts, filters }: Props) {
return (
<>
<Head title="Posts" />
<div className="container mx-auto py-8">
<h1 className="text-2xl font-bold mb-6">Posts</h1>
<div className="space-y-4">
{posts.data.map((post) => (
<article key={post.id} className="p-4 bg-white rounded-lg shadow">
<Link href={route('posts.show', post.id)}>
<h2 className="text-xl font-semibold hover:text-blue-600">
{post.title}
</h2>
Установить laravel-inertia-react в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл laravel-inertia-react?
Laravel + Inertia.js + React integration patterns. Use when building Inertia page components, handling forms with useForm, managing shared data, or implementing persistent layouts. Triggers on tasks involving Inertia.js, page props, form handling, or Laravel React integration.
Как установить скилл laravel-inertia-react?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл laravel-inertia-react запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic