Skip to content
Available for new work
Pages in Blog

GuidePremium

The Inertia front end for CoullWorks Blog for Laravel

Install the React or Vue pages with Tailwind or Bootstrap, wire the generated controller and routes, link the stylesheet, and understand the Index and Post pages and every Inertia config key.

Updated 16 November 2026Back to the package pageBuy

The Inertia front end gives you the blog as pages and components inside your own Inertia single-page app, in React or Vue, with Tailwind or Bootstrap 5. The package publishes the pages as stubs into your application, so you own them and can change them. It never imports an Inertia class itself. Your application owns the one controller that calls Inertia.

Install#

The blog home page, captured from the Blade set; the Inertia Index page draws the same page

The home page. The Inertia Index page is built to draw this same page, and its markup and styling come from the same tokens. The gallery has no capture taken from a React or Vue run, so this is the Blade capture.

Before you start, install inertiajs/inertia-laravel and the React (@inertiajs/react) or Vue (@inertiajs/vue3) adapter in your application. The package does not install them.

  1. Set 'frontend' => 'inertia' in config/coullworks-blog.php.
  2. Run the installer with the framework and the style:

    bash
    php artisan blog:inertia:install react tailwind

    The first argument is react (the default) or vue. The second is tailwind (the default) or bootstrap. Any other value stops with an error.

  3. The command publishes the page, component, block and type stubs to resources/js/blog, the three token files to resources/js/blog/styles, and the compiled stylesheet to public/vendor/coullworks-blog/blog-tailwind.css (or blog-bootstrap.css). It also writes app/Http/Controllers/Blog/InertiaBlogController.php and routes/blog-inertia.php, then prints the steps still to do.
  4. Do those steps:

    • Load the routes: add require base_path('routes/blog-inertia.php'); to routes/web.php.
    • Let your Inertia page resolver find the pages under resources/js/blog/pages. Page names start with the page_prefix (blog/pages/ by default), for example blog/pages/Index.
    • Link the stylesheet in your root Blade view: <link rel="stylesheet" href="{{ asset('vendor/coullworks-blog/blog-tailwind.css') }}">. The pages are then styled with no build step.
  5. Open the blog address.
OptionWhat it does
--routes-onlyWrites only the controller and route files; the stubs are not published
--forceOverwrites files that already exist. Without it, an existing controller is kept and the command says so
--domain=domain=prefixAdds a blog that answers on its own domain with its own path prefix. Repeat it for several. Blogs with a domain are also read from the database
--controller-path=Where to write the controller
--routes-path=Where to write the routes

Run the command again with --force after you change coullworks-blog.urls.patterns or the prefix, and again after you update the package, to refresh the published stylesheet.

To build the styles with your own pipeline instead of linking the compiled file, import the published files after Tailwind in your main CSS: @import "tailwindcss"; then @import "../js/blog/styles/tokens.css"; @import "../js/blog/styles/adapter.css"; @import "../js/blog/styles/blog.css"; @source "../js/blog";. For Bootstrap, load Bootstrap 5.3 CSS first and then those three files. Dark mode follows data-bs-theme. No Sass and no Bootstrap JavaScript are needed.

The Index page#

The blog home page, captured from the Blade set

What the Index page draws: the category pills, the lead post and the grid of cards. This is the Blade capture of the same page.

resources/js/blog/pages/Index.tsx (or Index.vue) draws the blog home page. The generated controller calls it with the properties built by the package's IndexProps. The same props shape serves the Category, Tag, Author and Archive pages, each of which has its own stub next to it. The main props are:

PropHolds
blogThe blog name, locale, enabled locales, the index, search and feed links and the consent cookie name
locale, kind, title, introThe language, which listing this is, the heading and an optional intro
posts, featuredThe cards for the page and the lead cards
paginationPage, last page, total, size, previous and next links and the page links
seo, crumbs, extrasHead tags, breadcrumbs and module extras (reading time, comments, related)
modegrid or list. Absent: the grid
sidebarThe sidebar widgets. Absent: no sidebar
navThe category filter. Absent: no filter

Props your controller does not send fall back to the plain layout: no sidebar, no filter, the grid. A Search page, a Not found page and the other stubs follow the same pattern. The TypeScript types for every prop are in resources/js/blog/types/props.ts.

The Post page#

An article: breadcrumbs, title, standfirst, byline and the hero image

The top of an article: the breadcrumb trail, the GUIDES kicker, the title, the standfirst, the byline with reading time, then the hero image. The Post page draws this same page; this is the Blade capture.

Post.tsx (or Post.vue) draws an article. Its props add:

PropHolds
post, blocksThe post's fields and its block list, drawn by the block components in resources/js/blog/blocks
authors, categories, tagsThe byline, the category kicker and the tag list
neighboursThe previous and next posts
templatearticle (no rail) or rail (the contents rail beside the text)
railThe first key takeaways block and the related posts, for the rail
readingMinutesThe reading time in minutes, or null
alternatesThe other-language versions, for hreflang
previewtrue when the page is a draft preview

The article grid, the rail, the type tokens and the slots are the same as in Blade: see Tokens and theming. To place a module extra in the call-to-action slot, register it with registerExtra(type, Component, 'cta') from resources/js/blog/extras/registry.ts.

After you register a custom block type, regenerate the TypeScript types with php artisan blog:inertia:types.

The Inertia config#

Publish the file with php artisan vendor:publish --tag=coullworks-blog-inertia-config. It is written to config/coullworks-blog-inertia.php. The same keys can go in the inertia array inside config/coullworks-blog.php, which wins.

KeyDefaultWhat it changes
prefixblogThe URL prefix the route stub is generated with. A blog's own path prefix still decides at run time
page_prefixblog/pages/The root of the Inertia component names, relative to your page resolver
preview_patternpreview/{token}The draft preview route, under the prefix. The token carries the post and the language
middleware['web']Middleware added to every generated route
featured_count1How many featured posts the index shows
cache_ttl300Seconds a built props array is kept

React or Vue#

The two sets have the same pages, components, blocks and props. The differences are the file type (.tsx or .vue) and the adapter. The Vue set has one extra component, CategoryTree, for the category sidebar widget. Class names for both are in resources/js/blog/lib/classes.ts. Both come in Tailwind and Bootstrap styles, which makes four stub sets in all.

Screenshots of the four Inertia sets#

Each set is captured on its own: React or Vue, with Tailwind or Bootstrap.

Inertia React Tailwind#

The Inertia React Tailwind blog home page at 1440 px: header, category pills, a lead post and cards

The Inertia React Tailwind listing on a 1440 px window.

The Inertia React Tailwind blog home page at 390 px: one column of cards

The Inertia React Tailwind listing at 390 px: the category pills wrap and the posts stack in one column.

The Inertia React Tailwind article page at 1440 px: breadcrumbs, the GUIDES kicker, the title, the standfirst, the byline with reading time and the hero image

The Inertia React Tailwind article page at 1440 px.

The Inertia React Tailwind article page at 390 px, with an On this page contents control under the hero image

The Inertia React Tailwind article page at 390 px. The contents sit in a collapsed On this page control.

The Inertia React Tailwind search page with the term tent filled in and one result card

The Inertia React Tailwind search page showing the one result for "tent".

The Inertia React Tailwind lightbox open over an article, showing the tarn photograph and its caption

The Inertia React Tailwind Figure lightbox open. The same dialog is used in every front end.

Inertia React Bootstrap#

The Inertia React Bootstrap blog home page at 1440 px: header, category pills, a lead post and cards

The Inertia React Bootstrap listing on a 1440 px window.

The Inertia React Bootstrap blog home page at 390 px: one column of cards

The Inertia React Bootstrap listing at 390 px: the category pills wrap and the posts stack in one column.

The Inertia React Bootstrap article page at 1440 px: breadcrumbs, the GUIDES kicker, the title, the standfirst, the byline with reading time and the hero image

The Inertia React Bootstrap article page at 1440 px.

The Inertia React Bootstrap article page at 390 px, with an On this page contents control under the hero image

The Inertia React Bootstrap article page at 390 px. The contents sit in a collapsed On this page control.

The Inertia React Bootstrap search page with the term tent filled in and one result card

The Inertia React Bootstrap search page showing the one result for "tent".

The Inertia React Bootstrap lightbox open over an article, showing the tarn photograph and its caption

The Inertia React Bootstrap Figure lightbox open. The same dialog is used in every front end.

Inertia Vue Tailwind#

The Inertia Vue Tailwind blog home page at 1440 px: header, category pills, a lead post and cards

The Inertia Vue Tailwind listing on a 1440 px window.

The Inertia Vue Tailwind blog home page at 390 px: one column of cards

The Inertia Vue Tailwind listing at 390 px: the category pills wrap and the posts stack in one column.

The Inertia Vue Tailwind article page at 1440 px: breadcrumbs, the GUIDES kicker, the title, the standfirst, the byline with reading time and the hero image

The Inertia Vue Tailwind article page at 1440 px.

The Inertia Vue Tailwind article page at 390 px, with an On this page contents control under the hero image

The Inertia Vue Tailwind article page at 390 px. The contents sit in a collapsed On this page control.

The Inertia Vue Tailwind search page with the term tent filled in and one result card

The Inertia Vue Tailwind search page showing the one result for "tent".

The Inertia Vue Tailwind lightbox open over an article, showing the tarn photograph and its caption

The Inertia Vue Tailwind Figure lightbox open. The same dialog is used in every front end.

Inertia Vue Bootstrap#

The Inertia Vue Bootstrap blog home page at 1440 px: header, category pills, a lead post and cards

The Inertia Vue Bootstrap listing on a 1440 px window.

The Inertia Vue Bootstrap blog home page at 390 px: one column of cards

The Inertia Vue Bootstrap listing at 390 px: the category pills wrap and the posts stack in one column.

The Inertia Vue Bootstrap article page at 1440 px: breadcrumbs, the GUIDES kicker, the title, the standfirst, the byline with reading time and the hero image

The Inertia Vue Bootstrap article page at 1440 px.

The Inertia Vue Bootstrap article page at 390 px, with an On this page contents control under the hero image

The Inertia Vue Bootstrap article page at 390 px. The contents sit in a collapsed On this page control.

The Inertia Vue Bootstrap search page with the term tent filled in and one result card

The Inertia Vue Bootstrap search page showing the one result for "tent".

The Inertia Vue Bootstrap lightbox open over an article, showing the tarn photograph and its caption

The Inertia Vue Bootstrap Figure lightbox open. The same dialog is used in every front end.

Available for new work

UK based · PHP · Python · JS · TS. Every first call is free.