laravel-inertia
Skill0 starsChanged 30 days agoMITView on GitHub
Développement Laravel avec Inertia.js et Vue 3 ou React. Pages, composants, loadings, prefetching, SSR. Utiliser quand on travaille sur un projet Laravel + Inertia, on crée des pages, ou on debug du code frontend.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- zhd4n/skillstheir own version, first seen Apr 7, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- zhd4n/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/laravel-core/templates/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- dokploy-deploySkill
- laravel-adminSkill
- laravel-aiSkill
- laravel-apiSkill
- laravel-coreSkill
- laravel-deploySkill
- laravel-livewireSkill
- laravel-mcpSkill
- laravel-microserviceSkill
- laravel-multi-tenancySkill
- laravel-nuxtSkill
- laravel-performanceSkill
- laravel-queueSkill
- laravel-securitySkill
- laravel-testingSkill
- laravel-websocketSkill
- nuxt-coreSkill
- nuxt-uiSkill
- pestSkill
- project-definerSkill
- scribeSkill
- searxng-mcpSkill
- sentrySkill
- skill-creatorSkill
- skill-health-checkerSkill
- spatie-query-builderSkill
The file
Files
Laravel Inertia — Inertia.js + Vue/React dans Laravel 13
Tu es un expert Inertia.js avec Laravel. Ton rôle est de guider le développement d'applications full-stack avec Inertia.
Quand utiliser
- Créer des pages Inertia
- Configurer les layouts partagés
- Gérer les navigations partielles
- Implémenter le SSR
- Debuguer le code frontend
Structure
resources/js/
├── Pages/ — Pages Inertia
│ ├── Posts/
│ │ ├── Index.vue — Liste des posts
│ │ ├── Show.vue — Détail d'un post
│ │ └── Create.vue — Formulaire de création
│ └── Layouts/
│ └── App.vue — Layout principal
├── Components/ — Composants réutilisables
├── composables/ — Composables Vue 3
└── app.ts — Point d'entréeController Inertia
<?php
namespace App\Http\Controllers;
use App\Models\Post;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;
class PostController extends Controller
{
public function index(): Response
{
return Inertia::render('Posts/Index', [
'posts' => Post::with('user')->paginate(20),
]);
}
public function show(Post $post): Response
{
return Inertia::render('Posts/Show', [
'post' => $post->load('user', 'comments.user'),
]);
}
public function store(Request $request)
{
$validated = $request->validate([
'title' => 'required|string|max:255',
'content' => 'required|string',
]);
$post = Post::create([
...$validated,
'user_id' => $request->user()->id,
]);
return redirect()->route('posts.show', $post)
->with('success', 'Post créé avec succès.');
}
}Page Vue 3
<script setup lang="ts">
import AppLayout from '@/Layouts/App.vue';
import { Link, router } from '@inertiajs/vue3';
import { ref } from 'vue';
interface Post {
id: number;
title: string;
content: string;
user: { name: string };
created_at: string;
}
const props = defineProps<{
posts: {
data: Post[];
meta: { current_page: number; last_page: number; total: number };
};
}>();
const search = ref('');
const filter = () => {
router.get(route('posts.index'), { search: search.value }, {
preserveState: true,
replace: true,
});
};
</script>
<template>
<AppLayout title="Posts">
<template #header>
<h1>Posts</h1>
</template>
<!-- Recherche -->
<input v-model="search" @input="filter" placeholder="Rechercher..." />
<!-- Liste -->
<div v-for="post in posts.data" :key="post.id">
<Link :href="route('posts.show', post.id)">
{{ post.title }}
</Link>
<span>{{ post.user.name }}</span>
</div>
<!-- Pagination -->
<div>
<Link
v-for="link in posts.meta.links"
:key="link.url"
:href="link.url"
:class="{ 'font-bold': link.active }"
v-html="link.label"
/>
</div>
</AppLayout>
</template>Partial Reloads
// Controller
public function show(Post $post): Response
{
return Inertia::render('Posts/Show', [
'post' => $post,
'comments' => $post->comments, // Rechargé seulement si nécessaire
]);
}<script setup>
import { router } from '@inertiajs/vue3';
// Recharger seulement les comments
router.reload({ only: ['comments'] });
</script>Prefetching
<script setup>
import { Link } from '@inertiajs/vue3';
</script>
<template>
<!-- Prefetch au hover -->
<Link :href="route('posts.show', post.id)" prefetch>
{{ post.title }}
</Link>
<!-- Prefetch on intent (hover ou focus) -->
<Link :href="route('posts.show', post.id)" prefetch="intent">
{{ post.title }}
</Link>
</template>Layouts partagés
// app/Http/Middleware/HandleInertiaRequests.php
public function share(Request $request): array
{
return [
'user' => $request->user() ? [
'id' => $request->user()->id,
'name' => $request->user()->name,
'email' => $request->user()->email,
] : null,
'flash' => [
'success' => fn () => $request->session()->get('success'),
'error' => fn () => $request->session()->get('error'),
],
];
}SSR (Server-Side Rendering)
# Installer le SSR
php artisan inertia:middleware// config/inertia.php
return [
'ssr' => [
'enabled' => true,
'url' => 'http://127.0.0.1:13714',
],
];Bonnes pratiques
Inertia::render()côté controller, pas de retour JSON- Partial reloads pour les navigations partielles
- Layouts partagés via
HandleInertiaRequests - Props typées côté frontend (TypeScript)
- Prefetching pour les navigations prévisibles
- Progress bar —
router.on('start', () => NProgress.start()) - Preserve scroll —
preserveScroll: truequand nécessaire - Error handling —
router.onError()pour les erreurs globales
Validation
- Toutes les pages utilisent
Inertia::render() - Layouts partagés configurés
- Partial reloads utilisés quand pertinent
- Props typées en TypeScript
- SSR configuré si nécessaire
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

