--- title: "Laravel SaaS Dashboard with Vue and Inertia" description: "A Laravel Vue Inertia walkthrough for SaaS dashboards: typed props, layout breadcrumbs, a debounced search, useForm, modal refs and permission checks in Vue 3." pageClass: blog-page date: 2026-09-29 author: erag category: frontend tags: [Vue, Inertia] --- # Laravel Vue Inertia Walkthrough: Building a SaaS Dashboard Page by Page You want to build a SaaS dashboard the way you'd build a classic Laravel app, but with Vue on the screen. That's what a Laravel Vue Inertia stack gives you. Routes, controllers, validation and permissions stay in PHP, and Vue 3 components take the place of Blade views. Below we build the parts almost every dashboard needs: typed page props, breadcrumbs, a searchable table, settings forms, modals and permission checks. Everything uses ` ``` You can write `ReportIndexProps` by hand or generate it from PHP, and we'd generate it. If your props come from spatie/laravel-data objects with a `#[TypeScript]` attribute, `php artisan typescript:transform` from spatie/laravel-typescript-transformer writes matching types into `resources/js/types`. The PHP class stays the single source of truth. Shared props, like the signed-in user, need a single declaration for the whole app. Inertia v3 reads it from a module augmentation: ```ts declare module '@inertiajs/core' { export interface InertiaConfig { sharedPageProps: SharedData; } } ``` From then on, `usePage().props.auth.user` is typed in every component. ## Breadcrumbs through the layout Most dashboard pages share one app layout, picked once in `app.ts` based on the page name. The page still has to tell that layout a few things, and breadcrumbs are the obvious one. In Inertia v3 a page can set `layout` to a plain props object. The default layout stays in place and receives the object as props: ```vue ``` There's one catch. `defineOptions` is hoisted out of `setup`, so it can't use the component's local variables or refs. When a layout value depends on data the page loads, call Inertia v3's `setLayoutProps()` from the page instead. Nesting and persistence are a bigger subject with their own article: [persistent layouts in Inertia](/blog/inertia-persistent-layouts.html). The `dashboard()` and `index()` helpers come from Laravel Wayfinder, which generates typed route functions from your PHP routes. ## A searchable table with a composable List pages usually have a search box that updates the URL. In Vue we split that into a small, reusable composable and a `watch`: ```ts const search = shallowRef(props.filters.search); const debouncedSearch = useDebounce(search, 300); watch(debouncedSearch, (value) => { router.get( index.url(), { search: value.trim() || undefined }, { preserveScroll: true, replace: true }, ); }); ``` Each detail here is deliberate. `shallowRef` is enough for a string and skips deep reactivity you don't need. `replace: true` stops every keystroke from adding a browser history entry, and `preserveScroll` keeps the table where the user left it. Sending `undefined` for an empty search drops `?search=` from the URL altogether. The composable itself accepts a ref, a getter or a plain value, using `MaybeRefOrGetter` and `toValue()`. It clears its timer in `onScopeDispose`, so nothing fires after the page unmounts. Composables like this live in `resources/js/composables` and are named `useSomething`. Render the rows with `v-for` and a `:key` on the record ID. For the paginator links that Laravel's paginator returns, use Inertia's `Link` with `preserve-scroll`. ## Settings forms with useForm Inertia gives Vue two ways to write forms. The `Form` component suits plain inputs posted to a route, and it has its own guide: [the Inertia Form component](/blog/inertia-form-component.html). `useForm` is the better fit when Vue controls the values, for example a layout picker made of clickable cards: ```ts const form = useForm({ app_layout: props.layoutSettings.app_layout ?? 'sidebar', sidebar_variant: props.layoutSettings.sidebar_variant ?? 'inset', }); const submit = () => { form.patch(update.url(), { preserveScroll: true, onSuccess: () => form.defaults(), }); }; ``` The returned object is reactive, so the template can read `form.app_layout`, `form.processing`, `form.isDirty` and `form.errors` directly. Don't skip the `form.defaults()` call after a successful save. It makes the saved values the new baseline, so `isDirty` goes back to `false` and a "Save changes" bar can hide itself. ## Modals with template refs and defineExpose We keep create and edit dialogs in one component that the page opens imperatively. The modal exposes an `open()` method: ```ts const selectedUser = shallowRef(null); const isOpen = shallowRef(false); const open = (user?: UserManagementUser) => { selectedUser.value = user ?? null; isOpen.value = true; }; defineExpose({ open, close: () => (isOpen.value = false) }); ``` The page holds a typed template ref and calls it: ```ts const userFormModal = ref | null>(null); const openEditModal = (user: UserManagementUser) => userFormModal.value?.open(user); ``` Give the form inside the modal a `:key` based on the record ID. Then switching from "edit Alice" to "create" mounts a fresh form, instead of carrying over the old values and errors. ## Permission checks in templates Your Laravel policies and route middleware decide what a user may do. The frontend only decides what to show. Share the user's permission names as a prop and wrap them in a composable: ```ts export function usePermission() { const page = usePage(); const can = (...permissions: string[]) => page.props.auth.isSuperAdmin || permissions.some((p) => page.props.auth.permissions.includes(p)); return { can }; } ``` In the template, `v-if="can('Create User')"` hides the button. **Always keep the server-side check**, because hiding a button protects nothing. The wider pattern, menus included, is covered in [permission-based menus in Laravel and Inertia](/blog/laravel-inertia-permission-menus.html). ## Checklist for a new Vue page When we add a page, this is what we check before calling it done: - Route with middleware and a name, and a thin controller calling a service - `Inertia::render('feature/Index', [...])` with only the props the page needs - `pages/feature/Index.vue` with `defineProps()` - Breadcrumbs via `defineOptions({ layout: { breadcrumbs } })` - Page title with `Head` - URLs from Wayfinder helpers, not hard-coded strings - `vue-tsc --noEmit` passes ## Frequently asked questions ### Should I use the Options API or the Composition API with Inertia? Both work, but we'd use `