<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>kitloom blog</title>
    <link>https://kitloom.dev/blog/</link>
    <description>News, guides and releases of kitloom: grow on Laravel, run it with AI.</description>
    <language>en</language>
    <atom:link href="https://kitloom.dev/blog/feed.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>Multi-location booking for a salon, in Laravel</title>
      <link>https://kitloom.dev/blog/multi-location-booking-for-a-salon-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/multi-location-booking-for-a-salon-in-laravel.html</guid>
      <pubDate>Sat, 21 Nov 2026 12:00:00 GMT</pubDate>
      <description>One salon at two addresses or more: each location with its own hours, phone and days closed, staff who work Monday in one and Friday in the other, and a booking page that asks where first. kitloom/bookings, in Filament or Nova, on one site with one client list.</description>
      <content:encoded><![CDATA[<p>A salon opens a second place across town. It is the same business: the same name, the same prices, the same clients, and some of the same people. Mira does colour on Linden Street from Monday to Wednesday and in Osborne Village on Fridays and Saturdays. Now the booking page has three new ways to go wrong. A client books Mira for a Friday at the wrong address, because the page does not know where she is that day. The floor in Osborne Village is redone on a Wednesday, and closing that day closes Linden Street too. The confirmation says &quot;see you at the salon&quot;, and the client goes to the one they know.</p>
<p>The usual fix is a second account in the booking system, with a second client list and a second calendar, and the staff in both. <a href="https://kitloom.dev/docs/modules/guides/bookings.html">kitloom/bookings</a> now keeps several locations on one site instead: one client base, one price list, one team, and every visit at a place.</p>
<h2 id="a-site-with-one-address-sees-nothing-new" tabindex="-1">A site with one address sees nothing new <a class="header-anchor" href="#a-site-with-one-address-sees-nothing-new" aria-label="Permalink to &quot;A site with one address sees nothing new&quot;">&ZeroWidthSpace;</a></h2>
<p>Until the first location is made, nothing changes. A salon at one address books as it always did, and no form, email or screen asks where.</p>
<h2 id="making-the-locations" tabindex="-1">Making the locations <a class="header-anchor" href="#making-the-locations" aria-label="Permalink to &quot;Making the locations&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Bookings → Locations → Make the first location from the settings</strong> turns the salon as it is into its first location. The address, the phone, the opening hours and <em>Also notify</em> move from <strong>Settings</strong> into it. Every staff member, every booking and every wish on the waitlist is put there, in one go. From then on the hours, the address and the phone belong to each location, and <strong>Settings</strong> says where they went.</p>
<p>A <strong>New location</strong> has:</p>
<ul>
<li>the name clients know it by, and a slug made from it;</li>
<li>the address, a line each, and its phone;</li>
<li>the <strong>Front desk's email</strong>, which hears of every booking there besides the staff member;</li>
<li>its <strong>Opening hours</strong> (a new one starts from the salon's);</li>
<li>its <strong>Days closed</strong>;</li>
<li>a picture and a page of the site;</li>
<li><strong>Services done here</strong>: nothing chosen means every service;</li>
<li><strong>Takes bookings</strong>.</li>
</ul>
<p>A service done in one place only says so on its own form, under <strong>Where</strong>: the hot towel shave needs the barber's chair, which is on Linden Street. A location is never deleted. <strong>Takes bookings</strong> off closes it to new visits, and its past visits keep saying where they were. That is refused while visits ahead, waitlist wishes or staff members' homes are still there, with how many of each.</p>
<h2 id="staff-at-two-locations" tabindex="-1">Staff at two locations <a class="header-anchor" href="#staff-at-two-locations" aria-label="Permalink to &quot;Staff at two locations&quot;">&ZeroWidthSpace;</a></h2>
<p>Each staff member has a <strong>Home location</strong>. They work there unless a row of their <strong>Hours</strong> names another <strong>Location</strong>. Mira's Monday to Wednesday rows stay empty (her home, Linden Street); her Friday and Saturday rows say Osborne Village. A day at both places is a row at each, 10:00–14:00 in one and 15:00–19:00 in the other, and the two may not overlap. Their bookings make them busy wherever they are, and their time off counts everywhere.</p>
<h2 id="closing-one-location-for-a-day" tabindex="-1">Closing one location for a day <a class="header-anchor" href="#closing-one-location-for-a-day" aria-label="Permalink to &quot;Closing one location for a day&quot;">&ZeroWidthSpace;</a></h2>
<p>A holiday at one address, or a repair, goes into that location's <strong>Days closed</strong>, with the reason. That location takes no visits then, and its staff can still work at the other one. A day closed for the whole business still closes them all, as before. Visits already booked on a closed day stay where they are, so the desk moves them to another day or to the other location, or tells the clients.</p>
<h2 id="what-the-client-sees" tabindex="-1">What the client sees <a class="header-anchor" href="#what-the-client-sees" aria-label="Permalink to &quot;What the client sees&quot;">&ZeroWidthSpace;</a></h2>
<p>Once two or more locations take bookings, <strong>Book</strong> asks <strong>Where</strong> first: a card for each, with its address. There is no &quot;anywhere&quot;: a booking needs a location. After the choice, the client sees only that location's services done by people who work there, and their free times there.</p>
<p>The day strip tells the days apart. <strong>Closed</strong> is a day that location is shut. <strong>Away</strong> is a day the chosen person is not in, because they are at the other location or off. <strong>Full</strong> is a day when every time is taken. A link with <code>?location=osborne-<wbr>village</code> opens Book with the place already chosen. A location's own page shows its address, hours and team under the owner's text, with <strong>Book here</strong>.</p>
<p>A client who moves their visit stays at its location, with a colleague who works there then. Only the salon moves a visit to another location, and the client is told as of any move.</p>
<p>The salon themes Atelier and Solace and the groomer's theme Fetch draw all of this, and show each location with its address, hours and phone. The kitloom app asks Where first in the same way, once the site has two locations.</p>
<h2 id="every-message-says-where" tabindex="-1">Every message says where <a class="header-anchor" href="#every-message-says-where" aria-label="Permalink to &quot;Every message says where&quot;">&ZeroWidthSpace;</a></h2>
<p>The confirmation, the reminder and its text, the calendar file, the visit's page, the visit in the account, the series and waitlist emails, and the Google Calendar event carry the visit's location: its name, address and phone. The front desk that hears of a booking is that location's.</p>
<h2 id="at-the-desk" tabindex="-1">At the desk <a class="header-anchor" href="#at-the-desk" aria-label="Permalink to &quot;At the desk&quot;">&ZeroWidthSpace;</a></h2>
<p>The reception calendar has <strong>Every location</strong> and a chip for each one. One location's day has a column for whoever works there that day, and <strong>Book here</strong> books there. A closed day is said above the calendar, <em>Osborne Village is closed all day · Floor repair</em>, and the hours there are striped. <strong>New booking</strong> asks the <strong>Location</strong> first. <strong>All Bookings</strong> has a <strong>Location</strong> column and filter, and a manager can change a booking's location, which counts as a move. Nova's calendar has the same switch on its week.</p>
<p>The waitlist and repeat visits keep their place. A wish names its location, or <strong>Any location</strong> when the desk leaves it so, and a time freed at one location is offered only to the wishes for it. A series of repeat visits stays at the first visit's location, and a date that location is closed is skipped and reported.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent sees each open location's hours by its name in <code>describe_<wbr>site</code>, and <code>bookings_<wbr>catalog</code> says whose each closure is. <em>&quot;Book Nora with Mira on Friday at ten&quot;</em> (<code>bookings_<wbr>create</code>) books where Mira works then. The agent's tools do not name a location yet, and a location's days closed are set on its form, not by the agent.</p>
<h2 id="what-is-not-there-yet" tabindex="-1">What is not there yet <a class="header-anchor" href="#what-is-not-there-yet" aria-label="Permalink to &quot;What is not there yet&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>A price per location.</strong> A service costs the same everywhere: its own price, or the staff member's.</li>
<li><strong>A manager of one location.</strong> Whoever manages the bookings sees and runs every location.</li>
<li><strong>The till by location.</strong> kitloom/booking-checkouts keeps one day's takings for the whole business.</li>
<li><strong>A one-day shift elsewhere.</strong> Only the weekly hours say where someone works.</li>
</ul>
<p>Salons of different owners or brands are not locations: each is a site of its own, on <a href="https://kitloom.dev/docs/modules/guides/multisite.html">kitloom/multisite</a>.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>Locations are a table of the module's own, <code>booking_<wbr>locations</code>, with <code>booking_<wbr>location_<wbr>services</code> for the services a location does not do. <code>location_<wbr>id</code> sits on staff, their hours, time off, bookings and waitlist wishes, and stays null on a site without locations. <code>Location<wbr>Writer</code> writes them with the acting user and has no delete. <code>Availability</code> takes an optional location, and with none it answers as it always did.</p>
<p>For a theme or an app: <code>GET /<wbr>wp-<wbr>json/<wbr>bookings/<wbr>v1/<wbr>locations</code> lists the open ones with their hours. <code>services</code>, <code>staff</code>, <code>slots</code>, <code>bookings</code>, <code>bookings/<wbr>quote</code> and <code>waitlist</code> take <code>location</code>, a slug or an id. A booking without one, where several take bookings, is a 422 <code>booking_<wbr>location</code>. The site's API at <code>/<wbr>api/<wbr>v1/<wbr>bookings</code> has <code>location_<wbr>id</code> and <code>location</code>. The locations themselves are not a resource of it yet.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/bookings/filament/locations.jpg" src="https://media.kitloom.dev/lessons/bookings/filament/locations.mp4"></video>
  <figcaption>A salon at two addresses: the first location from the settings, a second one, a service in one place, and Where on the booking page</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/bookings/filament/staff-two-locations.jpg" src="https://media.kitloom.dev/lessons/bookings/filament/staff-two-locations.mp4"></video>
  <figcaption>One person, two locations: a home, the hours by place, and the calendar of each</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/bookings/filament/location-closed.jpg" src="https://media.kitloom.dev/lessons/bookings/filament/location-closed.mp4"></video>
  <figcaption>Closing one location for a day while the other stays open</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>See it live:</strong> <a href="https://atelier.kitloom.dev" target="_blank" rel="noreferrer">atelier.kitloom.dev</a> is a hair salon on Linden Street and in Osborne Village, and <a href="https://grooming.kitloom.dev" target="_blank" rel="noreferrer">grooming.kitloom.dev</a> a dog and cat groomer in Riverside and Westbrook. Open Book and choose where.</li>
<li><strong>Have us build it:</strong> <a href="https://kitloom.dev/solutions/salon.html">the salon solution</a> or <a href="https://kitloom.dev/solutions/grooming.html">the grooming solution</a>.</li>
</ul>
<p>Locations come with kitloom/bookings, for either admin:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/bookings</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/bookings-filament</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> migrate</span></span></code></pre>
</div><p>On a Nova site, the second package is <code>kitloom/<wbr>bookings-<wbr>nova</code>. Every detail, from the desk to the routes, is in the <a href="https://kitloom.dev/docs/modules/guides/bookings.html">Bookings guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Dog grooming booking software, in Laravel</title>
      <link>https://kitloom.dev/blog/dog-grooming-booking-software-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/dog-grooming-booking-software-in-laravel.html</guid>
      <pubDate>Wed, 18 Nov 2026 12:00:00 GMT</pubDate>
      <description>Online booking for a dog and cat groomer: each pet's card with its size and what to watch for, only the grooms that fit it, vaccine records checked before the table, and a report of the groom for its owner. kitloom/booking-pets and the Fetch theme, in Filament or Nova, run by an AI agent too.</description>
      <content:encoded><![CDATA[<p>A groomer books a dog, not a person. A Yorkie's full groom takes an hour; a doodle's takes three and costs twice as much. The groomer has to know that Rex wears a muzzle for his nails before he is on the table, not after. His rabies vaccine has to be on file. And when his owner picks him up, they want to hear how it went.</p>
<p>General booking tools are made for haircuts. The pet is a line in a notes box. A client with two dogs has one history, so nobody can tell whose groom the visit six weeks ago was. &quot;Muzzle for nails&quot; sits among the client's other notes. A service cannot be for large dogs only, and the vaccines are checked at the door, on paper.</p>
<p><a href="https://kitloom.dev/docs/modules/guides/booking-pets.html">kitloom/booking-pets</a> makes the pet the thing that is booked, on top of <a href="https://kitloom.dev/docs/modules/guides/bookings.html">kitloom/bookings</a>. <strong>Fetch</strong>, a theme made for a groomer, draws it all on the site. It runs on a Laravel site with the groomer's own data, in Filament or Nova, and an AI agent can do the desk's routine work.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user manages the bookings knows the pets as well as the desk does:</p>
<ul>
<li><em>&quot;What should Nadia know before Juniper's groom tomorrow?&quot;</em> (<code>booking_<wbr>pets_<wbr>get</code> — what to watch for, the last groom notes, where the vaccines stand)</li>
<li><em>&quot;Book Rex's full groom, large, with Nadia on Thursday at ten.&quot;</em> (<code>bookings_<wbr>create</code>, for the pet)</li>
<li><em>&quot;Olive's owner brought the rabies paper, valid until March 2027. File it as checked.&quot;</em> (<code>booking_<wbr>pets_<wbr>vaccine</code> — add, verify or reject)</li>
<li><em>&quot;Add to Juniper: #5 on the body, teddy face, nervous at the dryer.&quot;</em> (<code>booking_<wbr>pets_<wbr>note</code>)</li>
<li><em>&quot;Write Juniper's report for today: bath, blow-dry, #5 on the body, calm and easy, a small mat behind the left ear, back in six weeks. Send it.&quot;</em> (<code>booking_<wbr>pets_<wbr>report</code>)</li>
</ul>
<p>Every tool works through the same code as the admin, as the user whose key the agent holds. A groomer's key reaches only the pets of the groomer's own clients. Notes are added, never changed, and no pet is ever deleted. A report the agent writes stays a draft until it is told to send it.</p>
<h2 id="the-pet-s-card" tabindex="-1">The pet's card <a class="header-anchor" href="#the-pet-s-card" aria-label="Permalink to &quot;The pet's card&quot;">&ZeroWidthSpace;</a></h2>
<p>A pet lives on its client's card. It has:</p>
<ul>
<li><strong>a name and a species</strong>: dogs and cats to start, and the list is yours to change;</li>
<li><strong>breed, sex, neutered, coat and colour</strong>;</li>
<li><strong>a birthday</strong>, where a guess will do, so the age shows as &quot;3 years&quot;;</li>
<li><strong>its weight</strong>, from which the size follows (<em>Small</em> to 10 kg, <em>Medium</em> to 25, and so on, on your own scale);</li>
<li><strong>health</strong>: allergies, conditions, medication and the vet;</li>
<li><strong>plays with others</strong>: yes, no or not known yet;</li>
<li><strong>what the staff must watch for</strong>: short lines such as <em>Muzzle for nails</em> or <em>Not with other dogs</em>.</li>
</ul>
<p><strong>The groomer's notes</strong> are kept with the pet, newest first: what was done (<em>#4 blade, teddy face</em>) and what to remember (<em>nervous at the dryer</em>). Each is signed and dated, and the next groomer starts from the last one. The client never sees the notes, what to watch for or the salon's own note.</p>
<p>A pet is never deleted. One that no longer comes is made <strong>inactive</strong>. One that died is marked <strong>passed away</strong>, by the salon or by the client. Either way it leaves the booking form, and no reminder ever names it again. Its history stays.</p>
<h2 id="only-the-grooms-that-fit" tabindex="-1">Only the grooms that fit <a class="header-anchor" href="#only-the-grooms-that-fit" aria-label="Permalink to &quot;Only the grooms that fit&quot;">&ZeroWidthSpace;</a></h2>
<p><em>Full groom, small</em> and <em>Full groom, large</em> are two services, each with its own minutes and price. <strong>Pets → Services by pet</strong> says which species and sizes each one is for. A pet is offered, and booked, only the services that fit it. A visit that does not fit is refused in plain words: <em>Full groom, large is not offered for Pip.</em> A pet whose size is not known yet is not turned away; you see it at the door.</p>
<p>A booking says whose it is: <em>Full groom — Rex</em>. That is how it appears on the list, on the calendar, in the client's emails and in their calendar file. A series of visits is for the same pet. <strong>Time to book again</strong> is about each pet, so Bella is reminded about even while Rex has a visit ahead.</p>
<p>A guest who books names their pet. It goes on the card their email or phone matches. If that card already has a pet of the same name, the visit is for that pet, and what the guest typed fills only what the card lacks. A guest is never shown what the card holds.</p>
<h2 id="what-to-watch-for-on-the-desk" tabindex="-1">What to watch for, on the desk <a class="header-anchor" href="#what-to-watch-for-on-the-desk" aria-label="Permalink to &quot;What to watch for, on the desk&quot;">&ZeroWidthSpace;</a></h2>
<p>The staff see what to watch for in red, on the visit, wherever it is shown: the bookings list, the calendar, the day on the desk. <strong>Pet card</strong> on a booking (Filament) opens the pet at the side: what to watch for, its details, the last notes, and a field for a note about this visit. In Nova, the pet opens from <strong>All Pets</strong>.</p>
<h2 id="vaccines-on-file" tabindex="-1">Vaccines on file <a class="header-anchor" href="#vaccines-on-file" aria-label="Permalink to &quot;Vaccines on file&quot;">&ZeroWidthSpace;</a></h2>
<p>Under <strong>Pets → Settings</strong> you choose which vaccines you keep and which species each is required for. Rabies is required for dogs and cats to start. A record has the vaccine, the day it is valid until, and a photo or PDF of the paper.</p>
<p>A record the client sends is <strong>to verify</strong> until the salon looks at the paper and presses <strong>Verify</strong>, or <strong>Reject</strong> with a reason the client reads. It counts for booking until it is rejected, so a new client can book online the same evening.</p>
<p><em>Vaccines asked at booking</em> has three settings:</p>
<ul>
<li><strong>Warn</strong> (to start): the booking goes through, and the staff see the gap as the last line of what to watch for: <em>Vaccines: Rabies — none on file</em>.</li>
<li><strong>Require</strong>: a booking from the site is refused until every required vaccine is valid on the day of the visit. Your own bookings at the desk are never refused.</li>
<li><strong>Off</strong>: nothing is asked or shown anywhere.</li>
</ul>
<p>The client is asked for a missing record by email after they book, at most once a week per pet. Fourteen days before a record runs out (your setting), at nine in the salon's morning, they are reminded. With <a href="https://kitloom.dev/docs/modules/guides/notifications.html">kitloom/notifications</a> the owner hears <em>Vaccine record to check</em> in their chat when a record comes in. The papers are private files, opened only through a link that lives a quarter of an hour.</p>
<h2 id="the-groom-report" tabindex="-1">The groom report <a class="header-anchor" href="#the-groom-report" aria-label="Permalink to &quot;The groom report&quot;">&ZeroWidthSpace;</a></h2>
<p>At the end of a visit, <strong>Report</strong> beside <em>Pet card</em> writes the owner a short note on how it went:</p>
<ul>
<li><strong>what was done</strong>, in the groomer's words;</li>
<li><strong>how it went</strong>: <em>Loved it</em>, <em>Calm and easy</em>, <em>A little nervous</em> or <em>A hard day</em>, with a line about it if you like;</li>
<li><strong>what we noticed</strong>: a mat behind the ear, a red patch;</li>
<li><strong>come back in</strong> so many weeks;</li>
<li><strong>the visit's photos</strong>, those already kept with the booking.</li>
</ul>
<p>It stays a <strong>draft</strong> until you send it. <strong>Save and send</strong> emails it to the client in the language they booked in, <em>Rex's groom today</em>, with who groomed him and a link to book the next visit. No photo goes into the email: the client sees the photos in their account, after signing in. A correction does not email the client again; <strong>Send again</strong> does. Two people pressing <em>Send</em> at once mail the client once. The bookings managers write reports, and so does a groomer for their own clients.</p>
<h2 id="the-site-fetch" tabindex="-1">The site: Fetch <a class="header-anchor" href="#the-site-fetch" aria-label="Permalink to &quot;The site: Fetch&quot;">&ZeroWidthSpace;</a></h2>
<p>Fetch is a Vue theme for a dog and cat groomer, made for phones first. It uses two colours that the owner sets, with every shade mixed from them. It has rounded headings, prices on little dog tags, drawn pictures and no web fonts. The front page shows what the studio does, the services by animal, how a visit goes, the groomers with their stars, the reviews, the hours and a journal. On a phone, a <strong>Book</strong> button stays under the thumb. Grooms named alike but for the size, <em>Full groom, small</em> to <em>Full groom, large</em>, appear as one entry with a row for each size.</p>
<p><strong>Book</strong> starts with the pet. A signed-in client picks one of their pets from cards with photos, or adds a new one with the vaccine dates the salon asks for. A guest names theirs. Then Book shows only the grooms that fit that pet, then the groomer and the time, then the details. A refusal about the pet or its vaccines shows under the pet.</p>
<p>The client's account has:</p>
<ul>
<li><strong>the dashboard</strong>: the next visit, <em>A new report for Juniper</em>, and <em>2 pets · 1 vaccine record to send</em>;</li>
<li><strong>Appointments</strong>: each visit names its pet, and the client can move or cancel it as the bookings allow, or press <em>Book again</em>;</li>
<li><strong>My pets</strong>: a card for each pet with <em>Book for…</em>, its vaccine records and where each stands (with the reason when one was turned down), <em>Send a record</em> with a photo of the paper, and its <strong>groom reports</strong>, newest open, marked <em>New</em> until read;</li>
<li><strong>Schedule</strong>, for a groomer who signs in.</li>
</ul>
<p><code>php artisan fetch:<wbr>demo</code> fills an empty site with a studio a year into its life: 120 clients, some 160 pets, about 1,200 visits, the groomers' notes, vaccine records in every state, reviews and some 155 groom reports. Deposits, discount codes, the waitlist and gift cards are not drawn in this first version.</p>
<h2 id="one-module-nothing-else-changed" tabindex="-1">One module, nothing else changed <a class="header-anchor" href="#one-module-nothing-else-changed" aria-label="Permalink to &quot;One module, nothing else changed&quot;">&ZeroWidthSpace;</a></h2>
<p>The bookings name no animal. They ask a contract of their own, <code>Visit<wbr>Subject</code>, whom a visit is for, and kitloom/booking-pets answers it. A site without the module books exactly as before. <em>My pets</em> stays off until a theme that can draw it switches it on, so the salon themes and every other site look as they did.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>The tables are the module's own: <code>booking_<wbr>pets</code>, <code>booking_<wbr>pet_<wbr>visits</code>, <code>booking_<wbr>pet_<wbr>notes</code>, <code>booking_<wbr>pet_<wbr>services</code>, <code>booking_<wbr>pet_<wbr>vaccines</code> and <code>booking_<wbr>pet_<wbr>reports</code>. They sit on Eloquent models the application can swap through the <code>Model<wbr>Registry</code>.</p>
<p><strong>Writing and reading:</strong></p>
<ul>
<li><strong><code>Pet<wbr>Writer</code> is the only writer</strong> of pets, notes, vaccine records, reports and a booking's pet, always with the acting user. It writes a report under the booking's row lock and claims its sending in one statement, so a double click mails once.</li>
<li><strong><code>Reports</code> holds the two rules</strong> that every screen and route asks: which visits take a report, and what a client may read.</li>
<li><strong><code>Visit<wbr>Subject</code></strong> is bound as the deposit's <code>Prepayment</code> is. <code>Booking<wbr>Writer</code> holds the pet inside the booking's transaction, and a client's own move asks again whether the vaccines cover the new day.</li>
</ul>
<p><strong>Around it:</strong></p>
<ul>
<li>REST <code>booking-<wbr>pets/<wbr>v1</code> for the client's own pets, records and reports, which any theme can draw;</li>
<li><code>/<wbr>api/<wbr>v1/<wbr>booking-<wbr>pets</code>;</li>
<li>pets brought in from a spreadsheet, matched to clients by email or phone;</li>
<li>privacy export and erase;</li>
<li>the owner's notice <code>pet.<wbr>vaccine_<wbr>reported</code>.</li>
</ul>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/booking-pets/filament/pet-card.jpg" src="https://media.kitloom.dev/lessons/booking-pets/filament/pet-card.mp4"></video>
  <figcaption>A pet's card: what to watch for, the groom notes, and Pet card on a booking</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/booking-pets/filament/book-for-a-pet.jpg" src="https://media.kitloom.dev/lessons/booking-pets/filament/book-for-a-pet.mp4"></video>
  <figcaption>Booking for a pet: services by species and size, and a groom that does not fit</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/booking-pets/filament/vaccines.jpg" src="https://media.kitloom.dev/lessons/booking-pets/filament/vaccines.mp4"></video>
  <figcaption>Vaccine records: the three modes, a record verified and one rejected</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/booking-pets/filament/visit-report.jpg" src="https://media.kitloom.dev/lessons/booking-pets/filament/visit-report.mp4"></video>
  <figcaption>The groom report: written, sent, and read in the client's account</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>On a kitloom site with bookings:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/booking-pets</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/booking-pets-filament</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> migrate</span></span></code></pre>
</div><p>On a Nova site, the second package is <code>kitloom/<wbr>booking-<wbr>pets-<wbr>nova</code>. For the groomer's site:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/fetch-theme</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> fetch:demo</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">npm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> run</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> build</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> site:theme</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> Fetch</span></span></code></pre>
</div><p>On a new site, <code>php artisan kitloom:<wbr>install --<wbr>theme=fetch --<wbr>demo</code> does it all in one step.</p>
<h2 id="try-it-1" tabindex="-1">Try it <a class="header-anchor" href="#try-it-1" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>See it live:</strong> <a href="https://grooming.kitloom.dev" target="_blank" rel="noreferrer">grooming.kitloom.dev</a> is the demo studio, open to anyone: book a visit for a pet, look through the groomers and the prices.</li>
<li><strong>Make a copy of your own, signed in to the admin, with no sign-up:</strong> <a href="https://filament.kitloom.dev/fetch" target="_blank" rel="noreferrer">with Filament</a> or <a href="https://nova.kitloom.dev/fetch" target="_blank" rel="noreferrer">with Nova</a>. It is yours for up to three days: open a pet's card, check a vaccine record, write a groom report, connect an agent.</li>
</ul>
<p>Every detail — the settings, the emails, the agent's tools, the routes for a theme — is in the <a href="https://kitloom.dev/docs/modules/guides/booking-pets.html">Pets guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>A website for a fishing tackle shop, on Laravel</title>
      <link>https://kitloom.dev/blog/fishing-tackle-shop-website-on-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/fishing-tackle-shop-website-on-laravel.html</guid>
      <pubDate>Tue, 17 Nov 2026 12:00:00 GMT</pubDate>
      <description>Shoal is a storefront theme for a tackle and outdoors shop on Laravel: hot deals with discount stickers, bestsellers beside the store's news, departments with a filter by brand, reviews, guides, delivery or pickup in store — edited in Filament or Nova, run by an AI agent, and open to try in a sandbox.</description>
      <content:encoded><![CDATA[<p>A tackle shop sells a lot of small things to people who know exactly what they want. The angler who comes in for a 7–28 g spinning rod does not want to scroll past tents; the one who drops by on Friday wants to see what is on sale before the weekend; and both want to call the shop and ask whether the reel is in stock at the store by the lake. A generic shop template gives you a grid of products and a search box. It does not put the deals up front, the phone number in sight and the season's news beside the bestsellers — the things a tackle shop's front counter does without thinking.</p>
<p>Shoal is a storefront theme for exactly that shop: a tackle and outdoors store with a few stores and a website that sells every day. It runs on kitloom, a Laravel CMS, with an admin your staff already know — Filament or Nova — and an AI agent that can do the routine work for you.</p>
<figure>
  <img src="https://kitloom.dev/blog/shoal/front.jpg" width="1280" height="960" alt="The Shoal front page: a charcoal tile with the logo, the phone number, the departments and a search box; a cart drawn as a shopping bag; a lime tile with the store's pages; under them a banner of an angler casting from a boat at dawn and, beside it, a tile offering ready-made tackle sets." loading="lazy">
  <figcaption>The front page of the demo store: the header in tiles, the banner and a tile beside it.</figcaption>
</figure>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, Claude, Cursor or your own agent runs the shop over MCP, with the rights of the user whose key it holds:</p>
<ul>
<li><em>&quot;Put the Arrow 4000 reel on sale at 74.90 until Sunday.&quot;</em> (<code>product_<wbr>save</code>)</li>
<li><em>&quot;Make a code SPRING15 for 15% off rods, for the first hundred customers.&quot;</em> (<code>coupon_<wbr>save</code>)</li>
<li><em>&quot;Which orders from yesterday are still waiting to be packed?&quot;</em> (<code>orders_<wbr>list</code>)</li>
<li><em>&quot;Order 1187 was picked up at the Lakeview store — mark it completed and thank the customer.&quot;</em> (<code>order_<wbr>set_<wbr>status</code>, <code>order_<wbr>add_<wbr>note</code>)</li>
<li><em>&quot;Change the phone in the header to the new number, and the line beside it to 'Help with an order, 7 am – 9 pm'.&quot;</em> (<code>theme_<wbr>customize</code>)</li>
<li><em>&quot;Add 'Ice fishing' to the categories line of the header.&quot;</em> (<code>menu_<wbr>save</code>)</li>
</ul>
<p>Every tool calls the same code as the admin's buttons, as the agent's user: a key given to someone who may not change prices cannot change them either, nothing is deleted for good, and every change is in the activity log. <code>describe_<wbr>site</code> tells the agent what the shop is made of — the departments, the attributes such as Brand, the menus and widget zones of the theme — so it writes a product as you would.</p>
<p>And the other side of the counter: your customer's own assistant can read the catalogue too. With <a href="https://kitloom.dev/docs/modules/guides/public-agents.html">kitloom/public-agents</a> switched on, a customer asks Claude <em>&quot;find me a light spinning rod under $90 from this shop&quot;</em>, and it searches the products (<code>search_<wbr>products</code>), reads one (<code>product_<wbr>details</code>) and hands back a link that opens the cart already filled (<code>cart_<wbr>link</code>).</p>
<h2 id="deals-up-front-news-beside-the-bestsellers" tabindex="-1">Deals up front, news beside the bestsellers <a class="header-anchor" href="#deals-up-front-news-beside-the-bestsellers" aria-label="Permalink to &quot;Deals up front, news beside the bestsellers&quot;">&ZeroWidthSpace;</a></h2>
<p>The front page is built the way a tackle shop's counter is:</p>
<ul>
<li><strong>Hot deals</strong> come first, in a strip under the banner: each product with a HOT tag and its discount on a sticker, the old price crossed out, four at a time with arrows when there are more.</li>
<li><strong>Bestsellers</strong> follow in big grey capitals, in up to three columns, with stars, the department, the price and a <em>Buy</em> button — and beside them a dark column of the store's news: the pike season, a casting day, the fishing school's course.</li>
<li><strong>Departments</strong> are tiles, each with its picture in a lime circle; <strong>guides</strong> from the water close the page; and a footer of a lime and a charcoal band, each under a long, gentle wave, carries the store hours, the links and the phone once more.</li>
</ul>
<figure>
  <img src="https://kitloom.dev/blog/shoal/deals.jpg" width="1280" height="960" alt="A strip of hot deals: four products, each in a circle with a red HOT tag and a yellow discount sticker of 16 to 20 percent, with old and new prices. Below, the heading BESTSELLERS with three product cards, and a dark column titled News from the water with three dated news items, and a dashed box Catch of the week with a newsletter link." loading="lazy">
  <figcaption>Hot deals, the bestsellers and the store's news in one view.</figcaption>
</figure>
<p>The header keeps the phone in sight on every page, with a line beside it that says when someone answers. The categories line opens each department's sections, and the search is right under it. Over the header there are a few quick links, each with an icon in a lime circle: <em>Bestsellers</em>, <em>New in</em>, <em>On sale</em>.</p>
<h2 id="a-catalogue-that-knows-the-brands" tabindex="-1">A catalogue that knows the brands <a class="header-anchor" href="#a-catalogue-that-knows-the-brands" aria-label="Permalink to &quot;A catalogue that knows the brands&quot;">&ZeroWidthSpace;</a></h2>
<p>The catalogue, the product page, the cart, the checkout and the customer's account come from kitloom's shop. A department shows its sections and a filter by <strong>Brand</strong>, sorting and a count. A product page has its gallery, the stock, the reviews with stars and the SKU. A product sold in sizes — wading boots, a jacket — has a price and stock per size.</p>
<figure>
  <img src="https://kitloom.dev/blog/shoal/catalog.jpg" width="1280" height="960" alt="The Reels department: a heading, one line about the reels, six products, a Reels button to pick a section, a Brand filter and a sorting list, then four product cards with photos of reels, stars, prices and Buy buttons, two of them with a 16 percent discount." loading="lazy">
  <figcaption>A department with its sections, a filter by brand and sorting.</figcaption>
</figure>
<figure>
  <img src="https://kitloom.dev/blog/shoal/product.jpg" width="1280" height="960" alt="The page of the Arrow 4000 spinning reel: a large photo with a minus 16 percent tag, the title, five stars and two reviews, the old price 89.00 and the new 74.90, In stock, one line of description, a quantity and an Add to cart button, the SKU and the category Spinning reels." loading="lazy">
  <figcaption>A product page: the deal, the stock and the reviews at a glance.</figcaption>
</figure>
<p>Delivery is what the shop sets: a flat rate, free over an amount, pickup at one of the stores, a rate abroad. Payments go through <a href="https://kitloom.dev/docs/modules/guides/payments.html">kitloom/payments</a> — Stripe, PayPal, Mollie, Square or an offline method such as paying at pickup — and a paid order gets its invoice as a PDF with <a href="https://kitloom.dev/docs/modules/guides/invoices.html">kitloom/invoices</a>.</p>
<h2 id="everything-is-edited-where-you-expect-it" tabindex="-1">Everything is edited where you expect it <a class="header-anchor" href="#everything-is-edited-where-you-expect-it" aria-label="Permalink to &quot;Everything is edited where you expect it&quot;">&ZeroWidthSpace;</a></h2>
<p>Nothing in the theme is written into its code. The shop's owner changes it all in the admin:</p>
<ul>
<li><strong>The phone, the line beside it, the address and the email</strong> — <em>Appearance → Customize → Store contacts</em>; the two colours under <em>Colors</em>, the logo under <em>Header</em>. Every shade of the design is mixed from the two colours, lime and charcoal by default, so a shop in its own colours is two clicks away. Text on the lime is charcoal: white on it is too faint to read.</li>
<li><strong>The banner</strong> is the front page itself: its title is the headline, its excerpt the text, its featured image the picture.</li>
<li><strong>The rows of the front page</strong> are the page's own text: <code>[products on_<wbr>sale=&quot;1&quot;]</code> is the hot deals strip, the next <code>[products …]</code> the bestsellers, <code>[product_<wbr>categories]</code> the department tiles — move them, and the page follows.</li>
<li><strong>Menus and widgets</strong> — the categories line, the links over the header, the store's pages in the lime tile, the footer's columns and social links; the tile beside the banner, the news column, the footer's text — are WordPress-style menus and widget zones under <em>Appearance</em>.</li>
</ul>
<figure>
  <img src="https://kitloom.dev/blog/shoal/footer.jpg" width="1280" height="960" alt="Customer reviews in four cards with stars and the product each is about, then the footer: a lime band under a gentle wave with the logo, a line about the shop, the store hours and three columns of links — Fishing, Outdoors, Help — and a charcoal band under another wave with the phone, the address, an email link and four social icons." loading="lazy">
  <figcaption>The reviews and the footer under its waves: the hours, the links and the phone once more.</figcaption>
</figure>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>Shoal is a <a href="https://kitloom.dev/blog/child-themes-in-laravel.html">child theme</a> of Pantry, kitloom's Vue storefront: <code>extra.<wbr>kitloom.<wbr>theme.<wbr>parent:<wbr> Pantry</code> in its <code>composer.<wbr>json</code>. Pantry's catalog, product page, cart, checkout and account keep their markup and take Shoal's design from its <code>resources/<wbr>style.<wbr>css</code>, read after Pantry's; Shoal replaces only the components it changes — the layout, the front page, the deals strip — at the same <code>@/</code> paths. Its theme settings are <code>Theme<wbr>Setting</code>s kept in <code>theme_<wbr>mods_<wbr>Shoal</code>, the colours as CSS variables in the page head; its menus and zones are registered in <code>boot<wbr>Theme()</code>; and its one part of its own, the journal row, is the newest posts that have a featured image, so a short piece of news without one stays in the news column.</p>
<p><code>php artisan shoal:<wbr>demo</code> fills an empty site with a tackle shop of three stores: six departments with fourteen sections, 34 products of made-up makers with a Brand attribute, a third on sale, two with sizes, 65 reviews, delivery and a coupon, the pages, the news and the guides with comments, every menu and zone. Every picture in the package is drawn; the stand and the sandboxes below show photos instead.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>See it live:</strong> <a href="https://fishing.kitloom.dev" target="_blank" rel="noreferrer">fishing.kitloom.dev</a> is the demo shop, open to anyone.</li>
<li><strong>Make a copy of your own, signed in to the admin, with no sign-up:</strong> <a href="https://filament.kitloom.dev/shoal" target="_blank" rel="noreferrer">with Filament</a> or <a href="https://nova.kitloom.dev/shoal" target="_blank" rel="noreferrer">with Nova</a>. It is yours for up to three days: change the colours, add a product, connect an agent.</li>
<li><strong>Have us build it:</strong> <a href="https://kitloom.dev/solutions/fishing.html">the tackle store solution</a> — your shop on Shoal, in your colours, with your catalogue moved over.</li>
</ul>
<p>On a kitloom site of your own:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/shoal-theme</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    # brings kitloom/pantry-theme with it</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">npm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> run</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> build</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> shoal:demo</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> site:theme</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> Shoal</span></span></code></pre>
</div><p>Every detail — where each word on the page comes from, the menus, the zones — is in the <a href="https://kitloom.dev/docs/themes/catalog.html#shoal">theme catalog</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Discounts and promo codes for a salon, in Laravel</title>
      <link>https://kitloom.dev/blog/discounts-and-promo-codes-for-a-salon-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/discounts-and-promo-codes-for-a-salon-in-laravel.html</guid>
      <pubDate>Mon, 16 Nov 2026 12:00:00 GMT</pubDate>
      <description>A promo code for a first visit, quiet mornings and last-minute times that cost less by themselves, a discount given at the till, each with limits per client and in all; the deposit and the bill follow, taxes on what is left. kitloom/booking-discounts, in Filament or Nova.</description>
      <content:encoded><![CDATA[<p>&quot;First visit −15 %&quot; is how a salon brings in new clients, and Tuesday at ten is a chair nobody sits in. A salon without discounts in its booking either hands out a code that nobody checks at the till, or leaves the quiet hours empty. One that types a discount into the till by hand finds out at the end of the month that the code meant for one visit was used six times.</p>
<p>Fresha, Booksy, Vagaro and Boulevard all let a salon lower a price: a code the client types, a time that costs less by itself, a discount at the till. <a href="https://kitloom.dev/docs/modules/guides/booking-discounts.html">kitloom/booking-discounts</a> does the same on a Laravel site, with the salon's own data.</p>
<h2 id="a-promo-code" tabindex="-1">A promo code <a class="header-anchor" href="#a-promo-code" aria-label="Permalink to &quot;A promo code&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Discounts → New discount</strong>:</p>
<ul>
<li><strong>the name</strong> the client reads, <em>First visit</em>, and <strong>the code</strong>, <code>WELCOME15</code>. A client may type it in any case;</li>
<li><strong>what it takes off</strong>: a share or an amount;</li>
<li><strong>first visit only</strong>: a client who has never had a visit with you, by their card, their email or their phone;</li>
<li><strong>the limits</strong>: a new code is used once per client, and <em>uses in all</em> caps it at the first hundred.</li>
</ul>
<p>On the booking page the client opens <em>Have a code?</em> and types it. The price is struck through, the discount is named, and what is left shows under it, with the deposit worked out on that. A code that does not apply says why: <em>This discount is for a first visit</em>, <em>This discount has been used up</em>.</p>
<h2 id="quiet-hours-and-the-last-minute" tabindex="-1">Quiet hours and the last minute <a class="header-anchor" href="#quiet-hours-and-the-last-minute" aria-label="Permalink to &quot;Quiet hours and the last minute&quot;">&ZeroWidthSpace;</a></h2>
<p>A discount with no code applies by itself wherever its conditions hold:</p>
<ul>
<li><strong>Tuesday mornings</strong>: twenty percent, Tuesday and Wednesday from nine to twelve;</li>
<li><strong>Last minute</strong>: ten percent for a visit booked less than four hours before it starts;</li>
<li>or a Black Friday that runs four days, a discount for one stylist's new chair, one for colour only.</li>
</ul>
<p>The booking page lists them above the services, and the time picker marks every time they lower: <em>−20 %</em>. A visit gets one discount: the code a client types, or else the largest that applies by itself.</p>
<h2 id="at-the-till" tabindex="-1">At the till <a class="header-anchor" href="#at-the-till" aria-label="Permalink to &quot;At the till&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/modules/guides/booking-checkouts.html">kitloom/booking-checkouts</a>:</p>
<ul>
<li><strong>The bill</strong> shows the services at their own prices and the discount under them: <em>First visit (WELCOME15) −12.00</em>.</li>
<li><strong>Give a discount</strong> takes a share or an amount off the services or off everything, with a word why. A staff member gives up to ten percent themselves; a manager gives any.</li>
<li><strong>Discount code</strong> takes a code a walk-in brings. It counts as a use like one typed online.</li>
<li><strong>Taxes</strong> come out of what is left: a discount the salon gives lowers the GST on the bill. A gift card is different. It is a way of paying, and the bill stays as it is.</li>
<li><strong>Takings</strong> shows <em>Discounts given</em> beside the tips and the taxes.</li>
</ul>
<h2 id="kept-straight" tabindex="-1">Kept straight <a class="header-anchor" href="#kept-straight" aria-label="Permalink to &quot;Kept straight&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>Uses.</strong> Each time a discount lowers a visit is a use: held while the visit is ahead, kept once it happens or the client does not come, given back when the booking is cancelled. The limits count what is held and kept.</li>
<li><strong>A move.</strong> Moved to another time, a visit keeps its discount; moved to a colleague with their own prices, the same rule falls on theirs.</li>
<li><strong>Never deleted.</strong> An offer that ends is switched off, and what it took off stays on the visits it lowered.</li>
<li><strong>What it gave.</strong> <em>Discounts this month</em> on the dashboard: what discounts took off, the visits that had one, the first visits a first-visit code brought.</li>
</ul>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected:</p>
<ul>
<li><em>&quot;Make a code SPRING for 10 % off colour until the end of March, once per client.&quot;</em> (<code>booking_<wbr>discounts_<wbr>save</code>)</li>
<li><em>&quot;Would WELCOME15 work for a cut with Mira on Tuesday at ten?&quot;</em> (<code>booking_<wbr>discounts_<wbr>check</code>)</li>
<li><em>&quot;Which discounts were used this month?&quot;</em> (<code>booking_<wbr>discounts_<wbr>list</code>)</li>
</ul>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>The tables are the module's own, <code>booking_<wbr>discounts</code> and <code>booking_<wbr>discount_<wbr>uses</code>, on Eloquent models the application can swap through the <code>Model<wbr>Registry</code>.</p>
<p><strong>Writing and choosing:</strong></p>
<ul>
<li><strong><code>Discount<wbr>Writer</code> is the only writer.</strong> It saves the owner's discounts, and holds a use inside the booking's transaction, counting the limits again under a lock on the discount's row: two clients never take the last use of a code at once.</li>
<li><strong><code>Discounts</code> picks</strong> the discount for a visit and says why a code does not apply.</li>
</ul>
<p><strong>The bookings name no module.</strong> They ask through a new contract, <code>Visit<wbr>Discount</code>, bound the way the deposit's <code>Prepayment</code> is. The answer sits on the <code>Visit<wbr>Plan</code>, so the booking's price and a deposit quoted on it are what is left, while its services keep their own prices for the bill. <code>POST bookings/<wbr>quote</code> prices a visit before it is booked, and every free time carries its badge.</p>
<p><strong>The till</strong> reads the same contract. A discount is a bill line of its own, with a negative price, taxed as the lines it lowers.</p>
<p><strong>Around it:</strong></p>
<ul>
<li>webhook <code>booking_<wbr>discount.<wbr>used</code>, and a notice when a code is used up;</li>
<li><code>/<wbr>api/<wbr>v1/<wbr>booking-<wbr>discounts</code>;</li>
<li>privacy export and erase, which keep the amounts;</li>
<li>a spreadsheet of the uses.</li>
</ul>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/booking-discounts/filament/first-visit-code.jpg" src="https://media.kitloom.dev/lessons/booking-discounts/filament/first-visit-code.mp4"></video>
  <figcaption>A promo code for a first visit, and a client booking with it</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/booking-discounts/filament/quiet-hours.jpg" src="https://media.kitloom.dev/lessons/booking-discounts/filament/quiet-hours.mp4"></video>
  <figcaption>Quiet mornings and the last minute, marked in the time picker</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/booking-discounts</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/booking-discounts-filament</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> migrate</span></span></code></pre>
</div><p>On a Nova site, the second package is <code>kitloom/<wbr>booking-<wbr>discounts-<wbr>nova</code>. Atelier, the salon theme, draws the code field, the offers and the marked times.</p>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail — the conditions, the agent's tools, the routes — is in the <a href="https://kitloom.dev/docs/modules/guides/booking-discounts.html">Discounts guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Sell gift cards online for a salon, in Laravel</title>
      <link>https://kitloom.dev/blog/sell-gift-cards-online-for-a-salon-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/sell-gift-cards-online-for-a-salon-in-laravel.html</guid>
      <pubDate>Mon, 16 Nov 2026 12:00:00 GMT</pubDate>
      <description>Gift cards a client buys on the salon's site or at the front desk, sent by email on the day they choose with a card to print, spent at the till over one visit or several, never expiring. kitloom/gift-cards, in Filament or Nova, sold by an AI agent too.</description>
      <content:encoded><![CDATA[<p>December is when people buy gift cards: a haircut for a sister, an hour of nails for a mother. A salon that can only sell one at the desk misses everyone who shops at eleven at night, and the client who wanted to give one goes to the salon down the street that has a <em>Buy a gift card</em> button. The cards it does sell are a paper slip and a line in a notebook, and nobody knows what is left on card number 14.</p>
<p>Fresha, Square, Vagaro and Boulevard all sell gift cards. <a href="https://kitloom.dev/docs/modules/guides/gift-cards.html">kitloom/gift-cards</a> does it on a Laravel site with the salon's own data, its own payment provider and no share of the sale to anyone.</p>
<h2 id="sold-online" tabindex="-1">Sold online <a class="header-anchor" href="#sold-online" aria-label="Permalink to &quot;Sold online&quot;">&ZeroWidthSpace;</a></h2>
<p>On the salon's <strong>Gift cards</strong> page the buyer:</p>
<ul>
<li>picks an amount — the ones you offer, or one of their own in your range;</li>
<li>says whether it is for them or for someone else, with that person's name, email and a message;</li>
<li>chooses the day it goes, a birthday or Christmas morning;</li>
<li>pays through your online payment method (Stripe, PayPal, Square, Mollie — whichever kitloom/payments has switched on).</li>
</ul>
<p>The card is made when the payment provider confirms the money, never before. It goes out at nine that morning, your time, with a card to print attached: your name, the amount, the code and the message. The buyer gets a receipt and a copy at once.</p>
<h2 id="sold-at-the-desk" tabindex="-1">Sold at the desk <a class="header-anchor" href="#sold-at-the-desk" aria-label="Permalink to &quot;Sold at the desk&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Gift Cards → Sell a gift card</strong>:</p>
<ul>
<li>the amount;</li>
<li>how it was paid — cash, your bank terminal, another way;</li>
<li>whom it is for.</li>
</ul>
<p>The code shows once, and <strong>Print</strong> gives the card to hand over in an envelope. A manager may also give one away (<em>given, not paid</em>), and the card's history says so.</p>
<h2 id="spent-at-the-till" tabindex="-1">Spent at the till <a class="header-anchor" href="#spent-at-the-till" aria-label="Permalink to &quot;Spent at the till&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/modules/guides/booking-checkouts.html">kitloom/booking-checkouts</a>, <strong>Take a payment</strong> has <strong>Gift card</strong>, in either admin and in the staff's app:</p>
<ul>
<li>the code typed in, and <em>Check</em> says what is left;</li>
<li>the card pays what is due, or all it holds, and the rest is paid another way;</li>
<li>the bill and the receipt name it by its last four characters.</li>
</ul>
<p><strong>Give money back → Back onto the gift card</strong> returns what it paid onto it: a gift card's money never leaves as cash.</p>
<h2 id="kept-straight" tabindex="-1">Kept straight <a class="header-anchor" href="#kept-straight" aria-label="Permalink to &quot;Kept straight&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>What a card is:</strong></p>
<ul>
<li><strong>A code with a balance</strong> that carries from visit to visit.</li>
<li><strong>No expiry.</strong> Manitoba and most Canadian provinces do not allow an expiry date on a gift card; elsewhere, a setting in months.</li>
<li><strong>Kept encrypted.</strong> The code is shown everywhere by its last four characters, so a copy of the database spends nobody's card.</li>
</ul>
<p><strong>What the salon sees:</strong></p>
<ul>
<li><strong>The ledger.</strong> Every change of a balance — issued, spent, returned, corrected — is a line on the card's page, with who did it and why.</li>
<li><strong>What the cards still hold.</strong> A widget on the dashboard shows the total, the number the accountant asks for.</li>
<li><strong>Corrections and cancellations</strong> are a manager's, with a reason.</li>
<li><strong>The balance page.</strong> Anyone with a code sees what is left on it at <code>/<wbr>gift-<wbr>card/</code>, a page that refuses a guesser after five tries.</li>
</ul>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user sells cards can do it in words:</p>
<ul>
<li><em>&quot;Sell a $75 gift card to Ruth for her sister Lena, paid in cash.&quot;</em> (<code>gift_<wbr>cards_<wbr>sell</code> — it answers the code once)</li>
<li><em>&quot;What is left on card HC3B?&quot;</em> (<code>gift_<wbr>cards_<wbr>find</code>)</li>
</ul>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>The tables are the module's own: <code>gift_<wbr>cards</code>, <code>gift_<wbr>card_<wbr>entries</code> (the ledger) and <code>gift_<wbr>card_<wbr>purchases</code>. They sit on Eloquent models the application can swap through the <code>Model<wbr>Registry</code>.</p>
<p><strong>Writing and selling:</strong></p>
<ul>
<li><strong><code>Gift<wbr>Card<wbr>Writer</code> is the only writer.</strong> <code>issue</code>, <code>spend</code>, <code>give<wbr>Back</code>, <code>adjust</code> and <code>cancel</code> each lock the card's row and write a line, and <code>spend()</code> takes a reference, so a payment told twice is spent once.</li>
<li><strong>Selling online.</strong> <code>Selling\<wbr>Purchases</code> puts a purchase through kitloom/payments as a <code>Payable</code>.</li>
<li><strong>For a theme.</strong> The <code>gift<wbr>Cards</code> page part gives it everything its form needs, and a headless site posts to <code>gift-<wbr>cards/<wbr>v1/<wbr>purchases</code>.</li>
</ul>
<p><strong>The till.</strong> It names no module: kitloom/booking-checkouts takes another module's way of paying through a new contract, <code>Bill<wbr>Tender</code> — <code>check</code>, <code>take</code> inside the bill's lock, <code>give<wbr>Back</code>. Store credit or a loyalty balance would fit the same way.</p>
<p><strong>Around it:</strong></p>
<ul>
<li>events <code>Gift<wbr>Card<wbr>Issued</code> and <code>Gift<wbr>Card<wbr>Spent</code>;</li>
<li>webhooks <code>gift_<wbr>card.<wbr>sold</code> and <code>gift_<wbr>card.<wbr>used</code>;</li>
<li><code>/<wbr>api/<wbr>v1/<wbr>gift-<wbr>cards</code>;</li>
<li>privacy export and erase, which keep the ledger;</li>
<li>a spreadsheet export.</li>
</ul>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/gift-cards/filament/sell-at-the-desk.jpg" src="https://media.kitloom.dev/lessons/gift-cards/filament/sell-at-the-desk.mp4"></video>
  <figcaption>Sell a gift card at the front desk, print it, and see its page</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/gift-cards/filament/at-the-till.jpg" src="https://media.kitloom.dev/lessons/gift-cards/filament/at-the-till.mp4"></video>
  <figcaption>A visit paid with a gift card, and a refund back onto it</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/gift-cards</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/gift-cards-filament</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> migrate</span></span></code></pre>
</div><p>On a Nova site, the second package is <code>kitloom/<wbr>gift-<wbr>cards-<wbr>nova</code>. Atelier, the salon theme, has the Gift cards page ready.</p>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail — the settings, the agent's tools, the routes — is in the <a href="https://kitloom.dev/docs/modules/guides/gift-cards.html">Gift Cards guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>No-show fees and a card on file for a salon in Laravel</title>
      <link>https://kitloom.dev/blog/no-show-fees-and-a-card-on-file-for-a-salon-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/no-show-fees-and-a-card-on-file-for-a-salon-in-laravel.html</guid>
      <pubDate>Sun, 15 Nov 2026 12:00:00 GMT</pubDate>
      <description>Clients leave a card when they book online and nothing is charged; a no-show or a late cancellation is charged as the salon decides, through the salon's own Stripe account. kitloom/booking-deposits, in Filament or Nova, run by an AI agent too.</description>
      <content:encoded><![CDATA[<p>A balayage takes three hours. When the client does not come, the chair stays empty all afternoon and the colourist is paid for nothing. Asking for a deposit helps, but many clients close the booking form the moment it asks for money. So the big booking systems do something else: Fresha calls it capturing card details, Booksy calls it No-Show Protection. The client leaves a card when booking, nothing is charged, and the salon charges a fee only if the client does not come or cancels too late.</p>
<p><a href="https://kitloom.dev/docs/modules/guides/booking-deposits.html">kitloom/booking-deposits</a>, the deposits module of <a href="https://kitloom.dev/docs/modules/guides/bookings.html">kitloom/bookings</a>, now does this as well. On the Modules screen it is called <em>Deposits &amp; No-show Protection</em>. It works on a Laravel site, with the salon's own data and the salon's own Stripe account.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user manages the deposits reads the fees:</p>
<ul>
<li><em>&quot;Which no-show fees did not go through this month?&quot;</em> (<code>booking_<wbr>deposits_<wbr>fees</code>)</li>
<li><em>&quot;Did Ada pay her deposit for Tuesday?&quot;</em> (<code>booking_<wbr>deposits_<wbr>list</code>)</li>
</ul>
<p>Charging, waiving and refunding stay in the admin, with a person who decides.</p>
<h2 id="a-card-instead-of-a-deposit" tabindex="-1">A card instead of a deposit <a class="header-anchor" href="#a-card-instead-of-a-deposit" aria-label="Permalink to &quot;A card instead of a deposit&quot;">&ZeroWidthSpace;</a></h2>
<p>Under <strong>Deposits &amp; No-show Protection → Settings</strong>, a service asks for one of three things:</p>
<ul>
<li>nothing;</li>
<li>a deposit: a fixed amount, a share of the price, or the whole price;</li>
<li>a <strong>card on file</strong>.</li>
</ul>
<p>A card on file has two fees: one for a no-show and one for a late cancellation. By default each is half the visit; it can also be a fixed amount, or none. A service can have its own fees: colour and balayage, for example, while a quick trim asks for nothing at all. When a visit of several services includes one that asks for a deposit, the deposit wins.</p>
<p>On the booking form the client reads: <em>A card is needed to book. Nothing is charged now. 34.00 CAD if you miss the visit or cancel less than 12 hours before.</em> <strong>Book</strong> holds the time and opens Stripe's own page, where the client leaves the card. The bank's 3-D Secure check happens there, so a later fee needs nothing more from the client. Back on the site, the booking is made.</p>
<p>A client who booked from their account and left a card before is offered <em>Use Visa •••• 4242</em> and skips Stripe. A client who leaves a card and closes the tab still keeps the booking: the site asks Stripe before it lets a time go. The words the client agreed to are kept with the booking, with the time and the address, in case the charge is ever disputed.</p>
<p>The card stays on the salon's own Stripe account, under the same key the till uses. Our pages never see the card number, there is no platform in between, and nobody takes a share.</p>
<h2 id="a-no-show-a-late-cancellation" tabindex="-1">A no-show, a late cancellation <a class="header-anchor" href="#a-no-show-a-late-cancellation" aria-label="Permalink to &quot;A no-show, a late cancellation&quot;">&ZeroWidthSpace;</a></h2>
<p>When the client does not come, <strong>No-show</strong> asks <em>Charge the no-show fee — 34.00 CAD</em>. The switch starts on, and the amount can be lowered but never raised above what the client agreed to. The card is charged from the queue, and the client gets a receipt.</p>
<p>If the salon would rather not be asked, the setting <strong>Charge the no-show fee without asking</strong> charges the fee every time a no-show is marked. That includes a no-show marked from an email link or by an AI agent.</p>
<p>A client can cancel online until the cancelling limit. After that they call, and the salon cancels for them. Inside the limit, <strong>Cancel</strong> asks <em>Cancelled late by the client: charge the late-cancellation fee</em>. This switch starts off, because the salon also cancels for its own reasons. A decline never charges anything.</p>
<p>The same switch appears on the desk, in the staff member's day on the site, and in the mobile app.</p>
<h2 id="when-the-card-does-not-pay" tabindex="-1">When the card does not pay <a class="header-anchor" href="#when-the-card-does-not-pay" aria-label="Permalink to &quot;When the card does not pay&quot;">&ZeroWidthSpace;</a></h2>
<p>A card can be declined, or the bank can ask the client to confirm the charge. Either way, the fee stays owed:</p>
<ul>
<li>The client gets an email with a page to pay it with any card.</li>
<li>The owner gets a notice in Telegram, Slack or wherever <a href="https://kitloom.dev/docs/modules/guides/notifications.html">kitloom/notifications</a> sends them.</li>
<li>With the till of <a href="https://kitloom.dev/docs/modules/guides/booking-checkouts.html">kitloom/booking-checkouts</a>, the fee also appears on the client's next bill as <em>Unpaid no-show fee — Tue 3 Nov</em>. Paying the bill pays the fee.</li>
</ul>
<p><strong>Fees</strong> lists every fee and where it stands, and the menu counts the ones not paid. Each fee has:</p>
<ul>
<li><strong>Charge again</strong>, for when the client has topped up the card or spoken to the bank;</li>
<li><strong>Waive</strong>, to let the fee go;</li>
<li><strong>Refund</strong>, to send a paid fee back to the card.</li>
</ul>
<h2 id="cards-and-trusted-clients" tabindex="-1">Cards and trusted clients <a class="header-anchor" href="#cards-and-trusted-clients" aria-label="Permalink to &quot;Cards and trusted clients&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Cards on file</strong> shows the brand, the last four digits and the expiry of each card, and nothing more. <strong>Remove</strong> deletes the card at Stripe too, but not while it holds a booking still ahead: a no-show could not be charged then. Booksy works the same way. Clients see their cards under <em>Saved cards</em> in their account and remove them there.</p>
<p>Regulars can book without any of this. <em>No card or deposit needed</em> on the client's card lets them book from their own account with no card and no deposit. A guest who types a regular's email is asked like anyone else.</p>
<p>Bookings made at the desk or on the phone ask for nothing. <strong>Ask for a card</strong> on such a booking emails the client a page to leave one.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>Stripe is reached through Laravel's HTTP client, with no SDK, on one pinned API version:</p>
<ul>
<li>a Checkout Session in setup mode saves the card;</li>
<li>an off-session PaymentIntent, with an idempotency key per attempt, charges a fee;</li>
<li>a Checkout Session in payment mode collects a fee the card did not pay.</li>
</ul>
<p>There is no webhook to set up: the site asks Stripe when the client comes back, and the scheduler asks again before it lets a time go. Every fee paid is also a row in kitloom/payments' ledger.</p>
<p>The bookings module never names Stripe or this module. It asks its <code>Prepayment</code> contract two things:</p>
<ul>
<li>what is owed when booking — a deposit, or nothing now and a fee later;</li>
<li>what may be charged when a booking turns into a no-show or a late cancellation.</li>
</ul>
<p>The decisions draw their switch from the second answer. The till asks a contract of its own, <code>Client<wbr>Debt</code>, what a client still owes from elsewhere. Tests fake Stripe with <code>Fakes<wbr>Stripe<wbr>Cards</code>. The module comes with both admins, Filament and Nova.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>Three short lessons from the admin, narrated:</p>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/booking-deposits/filament/settings.jpg" src="https://media.kitloom.dev/lessons/booking-deposits/filament/settings.mp4"></video>
  <figcaption>Settings: a card on file for colour, the no-show and late-cancellation fees, charging without asking</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/booking-deposits/filament/no-show-fees.jpg" src="https://media.kitloom.dev/lessons/booking-deposits/filament/no-show-fees.mp4"></video>
  <figcaption>No-show fees: the fee lowered on No-show, the Fees list, a declined fee waived</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/booking-deposits/filament/cards-on-file.jpg" src="https://media.kitloom.dev/lessons/booking-deposits/filament/cards-on-file.mp4"></video>
  <figcaption>Cards on file, a trusted regular, and Ask for a card on a booking made by phone</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>It comes with kitloom/booking-deposits, for either admin:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/booking-deposits</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/booking-deposits-filament</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> migrate</span></span></code></pre>
</div><p>On a Nova site, the second package is <code>kitloom/<wbr>booking-<wbr>deposits-<wbr>nova</code>.</p>
<p>You can open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. In Atelier, the salon theme, balayage asks for a card on file, and Fees and Cards on file already hold a paid fee and a declined one. Cards are asked for only once Stripe is switched on with a test key.</p>
<p>Every detail — the fees, the emails, the agent's tools, the routes — is in the <a href="https://kitloom.dev/docs/modules/guides/booking-deposits.html">Deposits &amp; No-show Protection guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Repeat appointments and a waitlist for a salon in Laravel</title>
      <link>https://kitloom.dev/blog/repeat-appointments-and-a-waitlist-for-a-salon-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/repeat-appointments-and-a-waitlist-for-a-salon-in-laravel.html</guid>
      <pubDate>Sat, 14 Nov 2026 12:00:00 GMT</pubDate>
      <description>A regular's next six visits booked in one go, every four weeks at the same time with the same stylist; a full Saturday that tells the clients waiting for it the moment someone cancels. Two features of kitloom/bookings, in Filament or Nova, run by an AI agent too.</description>
      <content:encoded><![CDATA[<p>A regular comes every four weeks, Thursdays at ten, always to Mira. At the end of each visit the desk books the next one, and only the next one: the fifth is forgotten, the Thursday fills up, and the regular goes elsewhere. Meanwhile Saturday is full a week ahead. A client who wanted it gives up; on Friday night someone cancels, and the hour stays empty because nobody knew who wanted it.</p>
<p>Fresha, Booksy and Vagaro all have an answer for both: repeat appointments and a waitlist. <a href="https://kitloom.dev/docs/modules/guides/bookings.html">kitloom/bookings</a> has them now, on a Laravel site with the salon's own data, and an AI agent can do both for the desk.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user manages the bookings books the series and works the list:</p>
<ul>
<li><em>&quot;Book Nora's cut every four weeks until the end of March.&quot;</em> (<code>bookings_<wbr>repeat</code> — it shows the dates first, a taken one at the nearest free time that day, and books only when you say so)</li>
<li><em>&quot;Nora is moving away. Cancel the rest of her visits and thank her.&quot;</em> (<code>bookings_<wbr>series_<wbr>end</code> — the visit and every later one, one email)</li>
<li><em>&quot;Who is waiting for Saturday?&quot;</em> and <em>&quot;Put Ruth on the list for a blow-dry any morning next week; her number is 204 555 0199.&quot;</em> (<code>bookings_<wbr>waitlist</code> — list, add, end)</li>
</ul>
<h2 id="repeat-appointments" tabindex="-1">Repeat appointments <a class="header-anchor" href="#repeat-appointments" aria-label="Permalink to &quot;Repeat appointments&quot;">&ZeroWidthSpace;</a></h2>
<p>On the calendar, a visit's panel has <strong>Repeat</strong>. It asks for a rhythm — every one to twelve weeks — and either how many visits after this one, or the date of the last. Before anything is booked it lists every date it would book:</p>
<ul>
<li>a date that is free, at the same time with the same staff member;</li>
<li>a date whose time is taken, at the nearest free time that day, and the line says so (<em>Mon 11 Jan, 09:00 — 10:00 is taken</em>);</li>
<li>a day with nothing free at all, named under the list.</li>
</ul>
<p>Untick the week the client is away and press <strong>Book these visits</strong>. They are ordinary bookings: the calendar, the reminders, the till and the client's account treat them as any visit. Ten o'clock stays ten o'clock when the clocks change. The client gets <strong>one email</strong> with every date, its link to change or cancel it, and one calendar file with all of them; the staff member gets one too. Nobody gets an email per visit.</p>
<p>A visit of a series is marked ↻ on the calendar, and its panel says where it stands: <em>2 of 6, every 4 weeks</em>. When the regular stops coming, <strong>Cancel</strong> asks which visits: this one, or this visit and all after it — told in one email.</p>
<h2 id="a-waitlist" tabindex="-1">A waitlist <a class="header-anchor" href="#a-waitlist" aria-label="Permalink to &quot;A waitlist&quot;">&ZeroWidthSpace;</a></h2>
<p>Switch it on in <strong>Bookings → Settings → Waitlist</strong>, with how many days ahead a wish may reach. The booking page then says <strong>Tell me if a time frees up</strong> under the free times, and a client leaves a wish: the services, a stylist or anyone, the days, and the part of the day — morning, afternoon, evening or any time.</p>
<p>When a booking is cancelled, declined, let go unpaid or moved, the freed time goes at once to everyone whose wish it fits: an email, a text where the salon texts, a push in the salon's app. The message opens a page with the time, and one tap books it. The first to book has it; nothing is held, so the gap fills as fast as someone wants it, and a client is told again only after an hour, so a busy day does not flood a phone. A booking that covers the wish ends it.</p>
<p>The desk sees it all. <strong>Bookings → Waitlist</strong> lists the wishes, who, what, with whom, the days and where each stands; <strong>Add to the waitlist</strong> puts a client who called on it (a phone is enough), <strong>Book</strong> puts a wish on a free time of its days, <strong>Take off the list</strong> ends one. On the calendar, a day with wishes says so — <em>2 waiting for this day</em> — and the badge opens the list on that day. Clients see their open wishes on their account page and may leave them.</p>
<h2 id="moving-from-another-booking-system" tabindex="-1">Moving from another booking system <a class="header-anchor" href="#moving-from-another-booking-system" aria-label="Permalink to &quot;Moving from another booking system&quot;">&ZeroWidthSpace;</a></h2>
<p>A salon with years of clients in Fresha, Booksy, Square or Vagaro brings them along: their export, CSV or Excel, goes into <strong>Bookings → Clients → Import / Export</strong>. The columns are matched by the names these systems use (<em>Mobile phone</em>, <em>Client notes</em>, <em>Accepts marketing</em>, <em>Birthday</em>), a client the salon has already only gets what their card lacks, and the same file brought in twice doubles nobody. The guide says where each system keeps its export.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>Both are tables of the module's own, <code>booking_<wbr>series</code> and <code>booking_<wbr>waits</code> with <code>booking_<wbr>wait_<wbr>services</code>, on Eloquent models the application can swap through the <code>Model<wbr>Registry</code>. A series is planned by <code>Series<wbr>Planner::<wbr>preview()</code> and written by <code>Series<wbr>Writer</code>, which books each visit through the same <code>Booking<wbr>Writer</code> as any booking, under its lock; its visits announce themselves with <code>Booking<wbr>Requested::<wbr>$quietly</code>, so whoever tells people — an email, a push, the owner's notice — hears <code>Series<wbr>Booked</code> once instead, and whoever keeps records — a Google Calendar, a Zoom meeting, a webhook — does as for any booking. A freed time is heard by <code>Waitlist\<wbr>Freed<wbr>Time</code> from the bookings' own events and offered from the queue after the commit; the offer is <code>Events\<wbr>Wait<wbr>Offered</code>, so a module of your own can send it another way. It comes with both admins, Filament and Nova, and the REST routes <code>bookings/<wbr>v1/<wbr>waitlist</code> for a theme or an app.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/bookings/filament/repeat.jpg" src="https://media.kitloom.dev/lessons/bookings/filament/repeat.mp4"></video>
  <figcaption>Repeat visits: the dates looked at first, a taken time moved, the series on the calendar, the rest cancelled</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/bookings/filament/waitlist.jpg" src="https://media.kitloom.dev/lessons/bookings/filament/waitlist.mp4"></video>
  <figcaption>The waitlist: its settings, the day's badge, a caller added, a wish booked</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Both come with kitloom/bookings, for either admin:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/bookings</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/bookings-filament</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> migrate</span></span></code></pre>
</div><p>On a Nova site, the second package is <code>kitloom/<wbr>bookings-<wbr>nova</code>. Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail — the limits, the texts, the agent's tools, the routes — is in the <a href="https://kitloom.dev/docs/modules/guides/bookings.html">Bookings guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>A REST API for a Laravel CMS: typed filters, OpenAPI and tokens, without a controller</title>
      <link>https://kitloom.dev/blog/a-rest-api-for-a-laravel-cms.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/a-rest-api-for-a-laravel-cms.html</guid>
      <pubDate>Thu, 12 Nov 2026 12:00:00 GMT</pubDate>
      <description>Your site's content and your modules' records in one Laravel-shaped API at /api/v1: filters, sorting, includes and pages the same for every resource, an OpenAPI document of what the caller may do, tokens that act as their owner, and writes that go through the same rules as the admin.</description>
      <content:encoded><![CDATA[<p>Sooner or later a site needs to be read by something other than a browser: a mobile app, a front end in Next or Nuxt, a script that sends the week's numbers to a spreadsheet, a partner's system that books appointments. In a Laravel project that usually means a controller per model, a resource class per controller, some filtering written by hand, and a page of documentation that is out of date by the next release. Each new kind of record repeats it, and each one filters, pages and fails a little differently.</p>
<p>A site that came from WordPress has <code>/<wbr>wp-<wbr>json/<wbr>wp/<wbr>v2/</code>, and kitloom keeps it for the clients that speak WordPress. But its shape is WordPress's: <code>per_<wbr>page</code> and <code>X-<wbr>WP-<wbr>Total</code>, <code>title.<wbr>rendered</code>, one way of filtering for posts and another for terms. <code>kitloom/<wbr>rest-<wbr>api</code> is the API a new client should be written against: <code>/<wbr>api/<wbr>v1/</code>, named and shaped the Laravel way, one set of rules for every kind of record.</p>
<h2 id="one-way-to-ask-for-every-resource" tabindex="-1">One way to ask, for every resource <a class="header-anchor" href="#one-way-to-ask-for-every-resource" aria-label="Permalink to &quot;One way to ask, for every resource&quot;">&ZeroWidthSpace;</a></h2>
<p>Posts, pages, every post type and taxonomy of your theme, the media library, the authors, and the records of the modules you install — the bookings of a salon, for one — are all resources, and all answer the same query:</p>
<div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span>GET /api/v1/posts?filter[categories]=3,5&#x26;filter[published_at][gte]=2026-01-01</span></span>
<span class="line"><span>                 &#x26;sort=-published_at</span></span>
<span class="line"><span>                 &#x26;include=author,featured_image</span></span>
<span class="line"><span>                 &#x26;fields[posts]=title,url,published_at</span></span>
<span class="line"><span>                 &#x26;page[size]=10</span></span></code></pre>
</div><p><code>filter</code>, <code>sort</code>, <code>include</code>, <code>fields</code> and <code>page</code> are the same everywhere, and a list always answers <code>data</code>, <code>links</code> and <code>meta</code>. A name the resource does not have is a <code>400</code> that lists the names it does have — a typo in a filter never returns the whole table.</p>
<p>What makes this hold is that a resource declares its fields with a type: text, integer, date, one of a list, the ids of related records. The type decides which filters a field takes, whether it sorts, how a write is validated, how the value is written into the JSON, and what the OpenAPI document says about it. Nothing is described twice, so nothing drifts.</p>
<h2 id="the-reference-writes-itself" tabindex="-1">The Reference writes itself <a class="header-anchor" href="#the-reference-writes-itself" aria-label="Permalink to &quot;The Reference writes itself&quot;">&ZeroWidthSpace;</a></h2>
<p>In the admin, <strong>API → Reference</strong> lists every resource you may read: its addresses, its fields with their types, what can be written, how each is filtered and sorted, and what can be included. It is drawn for the person looking at it — an editor sees less than an administrator — and it changes the moment a module or a post type is added.</p>
<p>A program reads the same as an OpenAPI 3.1 document, <code>/<wbr>api/<wbr>v1/<wbr>openapi.<wbr>json</code>, also drawn for whoever asks. A developer generates a typed client from it instead of reading.</p>
<h2 id="tokens-that-act-as-a-person" tabindex="-1">Tokens that act as a person <a class="header-anchor" href="#tokens-that-act-as-a-person" aria-label="Permalink to &quot;Tokens that act as a person&quot;">&ZeroWidthSpace;</a></h2>
<p>Without a token, the API reads what a visitor of the site sees: published posts, public pages, the services a salon offers. To read drafts, private records or the bookings, or to write anything, a client sends a token made under <strong>API → Tokens</strong>. It is an application password, the same as the WordPress REST API takes, so one set of tokens serves both.</p>
<p>A token is its owner: it sees what they see in the admin and may do what they may do. One made <strong>Read only</strong> never writes, whatever happens to it. Each shows when it was last used, and <strong>Revoke</strong> ends it at once.</p>
<h2 id="writes-go-through-the-same-rules-as-the-admin" tabindex="-1">Writes go through the same rules as the admin <a class="header-anchor" href="#writes-go-through-the-same-rules-as-the-admin" aria-label="Permalink to &quot;Writes go through the same rules as the admin&quot;">&ZeroWidthSpace;</a></h2>
<p>The API never saves a model itself. A new post goes through the same writer as the admin's form: a contributor who tries to publish, or an author who edits someone else's post, gets a <code>403</code>, a slug is made unique, the post's terms are assigned. A booking made through the API asks the salon's free times and waits for the salon's answer, as one made on the site does; a client moves only their own, and only until the salon's cancelling limit.</p>
<p>Two things a client cannot do by accident:</p>
<ul>
<li><strong>Overwrite a newer change.</strong> Every record answers a version. A client that sends it back with <code>If-<wbr>Match</code> gets a <code>412</code> when someone saved in between, and nothing is written.</li>
<li><strong>Delete for good without asking.</strong> A write that cannot be undone answers <code>428</code> with a question and a token for that one request; the client shows the question and sends the request again with the token.</li>
</ul>
<p>While the site is closed for maintenance or &quot;coming soon&quot;, the API reads nothing out to the people the holding page holds; the roles that see a closed site read on.</p>
<h2 id="for-a-module-s-author" tabindex="-1">For a module's author <a class="header-anchor" href="#for-a-module-s-author" aria-label="Permalink to &quot;For a module's author&quot;">&ZeroWidthSpace;</a></h2>
<p>A module puts its records into the API by declaring a resource: its name, its typed fields, the query of everything a caller may ever see, who may do what, and a writer that hands on to the module's own. Filtering, sorting, paging, includes, versions, confirmations, the Reference and the OpenAPI document come with it. <code>php artisan rest-<wbr>api:<wbr>check</code> says whether every resource is sound.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/rest-api/filament/reference.jpg" src="https://media.kitloom.dev/lessons/rest-api/filament/reference.mp4"></video>
  <figcaption>API: the Reference, a list read in the browser, and a read-only token</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/rest-api/filament/settings.jpg" src="https://media.kitloom.dev/lessons/rest-api/filament/settings.mp4"></video>
  <figcaption>API settings: records on a page and requests a minute</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>, and its <code>/<wbr>api/<wbr>v1/</code> answers at once. Every query, field and status code is in the <a href="https://kitloom.dev/docs/modules/guides/rest-api.html">API guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Push notification campaigns for your store's app, from the Laravel admin</title>
      <link>https://kitloom.dev/blog/push-notification-campaigns-for-a-store-app-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/push-notification-campaigns-for-a-store-app-in-laravel.html</guid>
      <pubDate>Tue, 10 Nov 2026 12:00:00 GMT</pubDate>
      <description>Offers and news to the phones of a store's mobile app, written in the site's admin: a title, a text, a page a tap opens and a coupon it puts in the cart; audiences from the shop's own orders; opt-in asked in the app as Apple requires; quiet hours, a weekly cap, an inbox that keeps what was swiped away, and four honest numbers.</description>
      <content:encoded><![CDATA[<p>The app is on the customers' phones, and the first thing its owner wants to do with it is say something: the cider is back, there is ten percent off this week, the shop is closed on Monday. A push does that better than an email — it is read in seconds, on the screen people look at all day.</p>
<p>Then it turns out that sending one is a product of its own. A push service has a dashboard, an SDK to build into the app, and a price per subscriber. The audience — <em>those who bought cider</em> — lives in the shop, so it is exported and uploaded, and is out of date the next day. A tap on the push opens the app's front page, because the service knows nothing of the shop's products. And nobody at the service asks whether the customer agreed to any of it, which Apple does: its review guideline 4.5.4 allows promotional push only to people who opted in through the app's own interface, with a way to opt out in the same place. An app that pushes offers without asking is refused, or removed later.</p>
<p>The shop already has all the pieces: the phones, the customers, their orders, the products and the coupons. Since 1.19.0 <code>kitloom/<wbr>mobile-<wbr>apps</code>, the site's side of <a href="https://kitloom.dev/blog/mobile-app-for-an-online-store-on-laravel.html">the kitloom app</a>, sends the message itself.</p>
<h2 id="a-message-written-where-the-shop-is" tabindex="-1">A message, written where the shop is <a class="header-anchor" href="#a-message-written-where-the-shop-is" aria-label="Permalink to &quot;A message, written where the shop is&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Mobile app → Messages → New message</strong> is one form.</p>
<ul>
<li><strong>Title and text.</strong> A phone shows about forty characters of the title and a hundred and fifty of the text, and the form says so under each field. The app's inbox shows all of it.</li>
<li><strong>A tap opens</strong> a page of the site — a product, a category, a post, a page — found by its title with <em>Find a page</em>. The app opens it as its own screen, not in a browser. Left empty, a tap opens the inbox.</li>
<li><strong>A coupon</strong>: the code of a coupon published in the shop. The tap puts it into the cart, so the customer types nothing.</li>
<li><strong>Who gets it</strong>: everyone who said yes, only those signed in to an account, only guests; those who <strong>bought a product</strong>, or anything <strong>from a category</strong> (a paid order; a category counts with its subcategories); the phones of <strong>one language</strong>. The line under the choice says how many phones that is <em>now</em> — <em>4 phones get it now</em> — and changes as you choose.</li>
</ul>
<p><em>Create</em> saves a draft. Nobody gets a draft. <strong>Send test to my phone</strong> pushes it to the phones where the app is signed in to your own account, so you see it as a customer will: where the title is cut, where the tap leads, whether the coupon lands in the cart. Then <strong>Send now</strong>, or <strong>Schedule</strong> for a time in the site's time. The question before it goes names the count once more, and says what is true of every push: once it is out, it cannot be changed or taken back.</p>
<h2 id="only-to-those-who-said-yes" tabindex="-1">Only to those who said yes <a class="header-anchor" href="#only-to-those-who-said-yes" aria-label="Permalink to &quot;Only to those who said yes&quot;">&ZeroWidthSpace;</a></h2>
<p>Whatever the audience, a message reaches only the phones whose person <strong>said yes to offers and news in the app</strong>. The app asks softly and once — a card after an order, or on the third visit — and before the phone's own permission prompt, so a <em>no</em> costs nothing. The answer is kept with its time, per phone. <strong>Account → Offers and news</strong> in the app is a switch that takes it back in one tap.</p>
<p>Order notices are apart from this: <em>your order is on its way</em> needs no such yes, and switching offers off does not silence it.</p>
<p>Two settings keep the offers welcome, under <strong>Mobile app → Settings → Offers and news</strong>:</p>
<ul>
<li><strong>Quiet hours</strong>, 21:00 to 09:00 by default, in the site's time. A message due then — scheduled, or sent by hand late in the evening — goes in the morning, and the page says so: <em>Scheduled: goes at 11.11.2026 09:00, after the quiet hours</em>.</li>
<li><strong>Offers a phone gets in a week</strong>, two by default. A phone that had its share gets the next message in its inbox only, without a push. A shop with three things to say in a week does not become the app people mute.</li>
</ul>
<h2 id="an-inbox-because-a-push-is-gone-once-swiped" tabindex="-1">An inbox, because a push is gone once swiped <a class="header-anchor" href="#an-inbox-because-a-push-is-gone-once-swiped" aria-label="Permalink to &quot;An inbox, because a push is gone once swiped&quot;">&ZeroWidthSpace;</a></h2>
<p>A notification lives until it is swiped away, and half of them are swiped unread. So the app keeps what it was sent: <strong>Account → Messages</strong> lists every message, read or not, for ninety days, with the unread count on the tab. A tap there does what the push would have done — the page, the coupon. Signed in, a person sees what their other phones got too.</p>
<h2 id="how-it-did-in-four-numbers" tabindex="-1">How it did, in four numbers <a class="header-anchor" href="#how-it-did-in-four-numbers" aria-label="Permalink to &quot;How it did, in four numbers&quot;">&ZeroWidthSpace;</a></h2>
<p>Each message keeps four numbers, and the page says what each one is, because the names promise more than the phones' makers tell anyone.</p>
<table tabindex="0">
<thead>
<tr>
<th>Number</th>
<th>What it is</th>
</tr>
</thead>
<tbody>
<tr>
<td>Phones</td>
<td>The phones of the audience when it went</td>
</tr>
<tr>
<td>Pushed</td>
<td>Expo's push service took the push for the phone</td>
</tr>
<tr>
<td>Delivered</td>
<td>Apple or Google took it for the phone. Not that anyone saw it: neither says whether a notification was shown or swiped away</td>
</tr>
<tr>
<td>Opened</td>
<td>The person tapped the push, or opened the message in the inbox. The app says so; counted once per person</td>
</tr>
</tbody>
</table>
<p><em>Opened</em> is the only one a person did, so the list shows it with its share of those pushed.</p>
<h2 id="an-ai-agent-drafts-a-person-sends" tabindex="-1">An AI agent drafts; a person sends <a class="header-anchor" href="#an-ai-agent-drafts-a-person-sends" aria-label="Permalink to &quot;An AI agent drafts; a person sends&quot;">&ZeroWidthSpace;</a></h2>
<p>With kitloom/ai, an agent connected to the site has two tools: <code>mobile_<wbr>app_<wbr>messages_<wbr>list</code> reads the earlier messages and how they did, and <code>mobile_<wbr>app_<wbr>messages_<wbr>draft</code> writes a draft — title, text, link, coupon, audience — and answers how many phones it would reach. <em>Write an offer for the customers who bought cider, like the one that did best in October</em> is a request it can carry out. There is no tool that sends. The draft waits in Messages for someone with the permission <strong>Send messages to the app</strong> — administrators and editors hold it, and it is apart from managing the app's settings.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>A message is a row of <code>mobile_<wbr>messages</code>, written by <code>Messages\<wbr>Message<wbr>Writer</code> with the acting user: <code>create()</code>, <code>update()</code>, <code>schedule($message, $at)</code> — now when no time is given — <code>cancel()</code>, <code>reach($audience)</code>, <code>test($message, $actor)</code>. A link elsewhere than the site and a coupon the shop does not have are refused at their field.</p>
<p><code>Messages\<wbr>Sender</code> sends a hundred phones at a time, which is what Expo takes in one request: a queued <code>Send<wbr>Message<wbr>Chunk</code> under a cache lock, each job dispatching the next. A phone gets its row in <code>mobile_<wbr>message_<wbr>deliveries</code> <strong>before</strong> its push goes, so the message is in its inbox whatever becomes of the push, and a chunk that is tried again pushes only to the phones still waiting — nobody is told twice. <code>mobile-<wbr>apps:<wbr>send-<wbr>messages</code> runs every minute, starts what is due and picks up a message a killed worker left half sent. <code>mobile-<wbr>apps:<wbr>push-<wbr>receipts</code>, hourly, reads Expo's receipts: a good one marks the delivery, and a phone Apple or Google no longer know is forgotten.</p>
<p>The app's side is three routes under <code>app/<wbr>v1</code>: <code>PUT /<wbr>devices</code> carries the person's answer about offers, <code>GET /<wbr>messages</code> is the inbox by push token, <code>POST /<wbr>messages/<wbr>{id}/<wbr>opened</code> counts the open. The site lists <code>messages</code> among its features in <code>GET /<wbr>site</code>, and the app draws the inbox and the question only where it does. The app needed no new native module, so phones got all of this as an over-the-air update, with no store review.</p>
<p>With kitloom/privacy, <em>Export Personal Data</em> lists a person's devices with their answer about offers and the messages their phones got; <em>Erase</em> forgets the phones and their inboxes. Tests fake Expo with <code>Kitloom\<wbr>Mobile<wbr>Apps\<wbr>Testing\<wbr>Fakes<wbr>Expo</code>: <code>$this-<wbr>&gt;phone(offers:<wbr> true)</code>, send, and read <code>$this-<wbr>&gt;pushes()</code> back.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/mobile-apps/filament/messages.jpg" src="https://media.kitloom.dev/lessons/mobile-apps/filament/messages.mp4"></video>
  <figcaption>Mobile app: an offer to the phones that said yes</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>The stand is a real store: <strong>Prairie Hops</strong>, a craft beer shop, at <a href="https://pantry.kitloom.dev" target="_blank" rel="noreferrer">pantry.kitloom.dev</a>, with the app's Android build for testers. Every option, route and number above is in the <a href="https://kitloom.dev/docs/modules/guides/mobile-apps.html">Mobile app guide</a>; how the app itself is built from your site's name, icon and colours is in <a href="https://kitloom.dev/blog/mobile-app-for-an-online-store-on-laravel.html">A mobile app for your online store</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Real-time Laravel with Reverb: live orders, a notification bell and edit locks, without code</title>
      <link>https://kitloom.dev/blog/live-updates-in-laravel-with-reverb.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/live-updates-in-laravel-with-reverb.html</guid>
      <pubDate>Mon, 09 Nov 2026 12:00:00 GMT</pubDate>
      <description>Laravel Reverb on a whole site: new orders appear in the admin's list, notices ring the bell, two editors on one post see each other, comments and a customer's orders update on the page — with one process and no WebSocket code.</description>
      <content:encoded><![CDATA[<p>A shop owner keeps the order list open all morning and sees nothing new until they press F5. An editor fixes a typo in a post while a colleague rewrites its second half, saves last, and the typo is back. A customer waits on their account page for &quot;Shipped&quot; that came an hour ago. Every one of these is a page that does not know the site has changed.</p>
<p>Laravel has had the answer for a while: broadcasting, and since 2024 its own WebSocket server, <a href="https://laravel.com/docs/reverb" target="_blank" rel="noreferrer">Reverb</a>. What it does not give you is the wiring — which events go out, on which channels, who may listen to which, what the browser does with them, what happens when the WebSocket server is down during a checkout. That wiring is the same work in every project. <code>kitloom/<wbr>live</code> is that work done once, for every module of the site.</p>
<h2 id="what-changes-on-its-own" tabindex="-1">What changes on its own <a class="header-anchor" href="#what-changes-on-its-own" aria-label="Permalink to &quot;What changes on its own&quot;">&ZeroWidthSpace;</a></h2>
<p>With the Live module on and Reverb running beside the site:</p>
<table tabindex="0">
<thead>
<tr>
<th>Where</th>
<th>What updates without a reload</th>
</tr>
</thead>
<tbody>
<tr>
<td>The admin's bell</td>
<td>Each notice of an <strong>Admin</strong> channel — a new order, a booking request, a comment waiting — rings the bell of everyone who may see it, the moment it comes</td>
</tr>
<tr>
<td>The shop's order list</td>
<td>A new order is at the top of the list with &quot;New order #1043&quot; in the corner; an order completed elsewhere changes its status in the list</td>
</tr>
<tr>
<td>A post open twice</td>
<td>Whoever opens it second sees &quot;Anna is editing this&quot; and reads it; <strong>Take over</strong> gives it to them and turns Anna's form read-only, her unsaved text still there</td>
</tr>
<tr>
<td>The AI assistant</td>
<td>An answer goes on when you move to another page, and the chat there picks it up where it is</td>
</tr>
<tr>
<td>Pages of the site</td>
<td>A comment approved in the admin appears under the post; a customer's order that ships, and a client's booking that is confirmed or moved, show in their account</td>
</tr>
</tbody>
</table>
<p>The pages of the site update on the Vue and React themes, through Inertia's live props: a part of the page says which event refreshes it, and Inertia asks for that part again when the event arrives. A Blade theme draws the same page as before and shows the change on a reload.</p>
<h2 id="nobody-s-data-on-the-wire" tabindex="-1">Nobody's data on the wire <a class="header-anchor" href="#nobody-s-data-on-the-wire" aria-label="Permalink to &quot;Nobody's data on the wire&quot;">&ZeroWidthSpace;</a></h2>
<p>A broadcast says <em>that</em> something changed, never <em>what</em>. The order list hears &quot;order 1043, processing, new&quot; — no name, no address, no total — and reads its rows again itself, with the rights of whoever is looking. A comment's page hears that the post has a new comment and asks for the comments as that visitor sees them: the author of a held comment sees it, nobody else does.</p>
<p>Every private channel is checked against the site's own permissions: the order list's channel is for whoever may manage orders, a post's editing channel for whoever may edit that post, a bell and an account for their owner alone. Channel names carry the site's prefix, so the sites of a multisite, or a hundred sandboxes on one server, never hear each other.</p>
<h2 id="when-reverb-is-not-there" tabindex="-1">When Reverb is not there <a class="header-anchor" href="#when-reverb-is-not-there" aria-label="Permalink to &quot;When Reverb is not there&quot;">&ZeroWidthSpace;</a></h2>
<p>Nothing breaks. A broadcast goes out after the database commits and never at the cost of the write: Reverb down during a checkout costs the live update, not the order. The bell looks for news every 30 seconds, the order list shows what was there when it was opened, and the assistant streams its answer in the request as it always did.</p>
<p>The protection against overwriting does not need Reverb at all. Every edit form remembers the version of the post it opened, and a save over a newer one is refused with the name of who saved it and when:</p>
<blockquote>
<p>Not saved: Anna Berg changed this record at 10:42, after you opened it. Reload the page to see the new version.</p>
</blockquote>
<p>What you typed stays on the form. The same check holds for an AI agent: <code>get_<wbr>content</code> hands it the record's <code>version</code>, and <code>update_<wbr>content</code> with an old one is refused, naming who saved since — the agent reads the record again and redoes its change instead of undoing someone's work.</p>
<h2 id="setting-it-up" tabindex="-1">Setting it up <a class="header-anchor" href="#setting-it-up" aria-label="Permalink to &quot;Setting it up&quot;">&ZeroWidthSpace;</a></h2>
<ol>
<li>Switch the module on (Modules screen, or <code>composer require kitloom/<wbr>live kitloom/<wbr>live-<wbr>filament</code>).</li>
<li>Keep <code>php artisan reverb:<wbr>start</code> running: supervisor, systemd, Forge's daemons.</li>
<li>Let the web server pass <code>/<wbr>app/<wbr>…</code> on to Reverb, so browsers connect to the site's own address — no second port, no second certificate.</li>
</ol>
<p>There are no keys to type: the site and Reverb make them from the application key. <code>php artisan kitloom:<wbr>deploy-<wbr>kit</code> writes the Reverb process, the nginx lines and the restart after a deploy for a plain server, Forge, Ploi, Docker or DigitalOcean's App Platform. The admin's <strong>Live</strong> section says whether Reverb answers — <em>running</em>, <em>not running</em> — and <code>php artisan live:<wbr>status</code> says the same on the server.</p>
<h2 id="your-own-live-part" tabindex="-1">Your own live part <a class="header-anchor" href="#your-own-live-part" aria-label="Permalink to &quot;Your own live part&quot;">&ZeroWidthSpace;</a></h2>
<p>A module of your own makes a part of its page live with one interface: <code>Live<wbr>Part::<wbr>live<wbr>On($page)</code> answers the event whose broadcast refreshes the part there. The event is an ordinary Laravel <code>Should<wbr>Broadcast<wbr>Now</code> on a channel from <code>Live<wbr>Channels</code>, sent through <code>Broadcasts::<wbr>send()</code> — after the commit, failures reported and swallowed. No JavaScript: the theme's build adds the listening part by itself while the module is installed. The rules are in the <a href="https://kitloom.dev/docs/modules/guides/live.html">Live guide</a>.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>Four short lessons from the admin, narrated:</p>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/live/filament/live-status.jpg" src="https://media.kitloom.dev/lessons/live/filament/live-status.mp4"></video>
  <figcaption>Live updates with Laravel Reverb: what changes on its own, and whether Reverb is running</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/notifications/filament/admin-bell.jpg" src="https://media.kitloom.dev/lessons/notifications/filament/admin-bell.mp4"></video>
  <figcaption>Notifications in the admin's bell: an Admin channel, and a comment that rings it at once</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/shop/filament/live-orders.jpg" src="https://media.kitloom.dev/lessons/shop/filament/live-orders.mp4"></video>
  <figcaption>New orders without reloading the list</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/wp-schema/filament/editing-lock.jpg" src="https://media.kitloom.dev/lessons/wp-schema/filament/editing-lock.mp4"></video>
  <figcaption>Two people on one post: who is editing, and taking it over</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Everything above — the server, the settings, the channels, the parts of every module — is in the <a href="https://kitloom.dev/docs/modules/guides/live.html">Live guide</a>. How the notification channels work outside the admin is in <a href="https://kitloom.dev/blog/telegram-notifications-in-laravel.html">Telegram and Slack notifications in Laravel</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>A mobile app for your online store, from the same Laravel admin</title>
      <link>https://kitloom.dev/blog/mobile-app-for-an-online-store-on-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/mobile-app-for-an-online-store-on-laravel.html</guid>
      <pubDate>Sat, 07 Nov 2026 12:00:00 GMT</pubDate>
      <description>One app for every kitloom store, on iPhone and Android: the catalogue from the site's own pages, a cart on the phone priced by the site, the site's checkout and account, push when an order moves. Built from the site's name, icon and colours under your own Apple and Google accounts; the Mobile app module is the site's side.</description>
      <content:encoded><![CDATA[<p>A store that sells well on the web gets asked for an app sooner or later. Customers want it on the home screen, they want to be told when the parcel ships, and the owner wants a second shop window that nobody has to find in a browser. Then the quotes come in. An agency builds one from scratch for the price of a car, and it has its own backend to keep in step with the shop. The app builders re-skin a template for a monthly fee, and every rule the shop has — a coupon that applies to one category, free delivery from sixty dollars, a product you can only buy on the site — has to be made twice or dropped.</p>
<p>The shop already knows all of that. Its pages know what is in stock and at what price, its cart knows the coupons and the shipping zones, its checkout knows which fields it needs and which payment methods it offers. An app should ask the shop and draw the answer, not know it again.</p>
<p>That is what the kitloom app does, and since 1.17.0 <code>kitloom/<wbr>mobile-<wbr>apps</code> is the site's side of it.</p>
<h2 id="one-app-your-store" tabindex="-1">One app, your store <a class="header-anchor" href="#one-app-your-store" aria-label="Permalink to &quot;One app, your store&quot;">&ZeroWidthSpace;</a></h2>
<p>The app is one Expo (React Native) project, <a href="https://github.com/kitloom/app" target="_blank" rel="noreferrer"><code>kitloom/<wbr>app</code></a>, for every kitloom store. A single file, <code>kitloom.<wbr>json</code>, names the site: its address, its name, colours, the icon and the splash, the bundle id. <code>npm run configure --<wbr> https://<wbr>your-<wbr>store.<wbr>example</code> fills it from the site itself, and <code>eas build</code> makes the iPhone and Android builds in Expo's cloud under <strong>your own</strong> Apple Developer and Google Play accounts, so the app in the stores is yours, under your name, with your icon. No Xcode on anyone's desk.</p>
<p>What the customer gets on the phone:</p>
<ul>
<li><strong>Home</strong>: the shop's banners, the categories, shelves of what is on sale, new and popular — the same records the site's front page shows.</li>
<li><strong>Shop</strong>: search, categories, sorting, and the attribute filters of the catalogue — the style of a beer, its strength, the format — the same filters as on the site's archive, read from the same page.</li>
<li><strong>A product</strong>: its gallery with pictures to pinch and zoom, the variations, the reviews, the related products, a quantity and <em>Add to cart</em>.</li>
<li><strong>The cart</strong>: kept on the phone, swipe a line away, a coupon, the shipping rates for the address, and the totals the site worked out.</li>
<li><strong>Checkout in three steps</strong>: address, delivery, payment. A signed-in customer is not asked what the site already knows; a shop that delivers in one city asks only for the street. Cash on delivery and a bank transfer end in the app; a card gateway opens in the browser and the app reads the order back.</li>
<li><strong>The account</strong>: the orders with their status, the addresses, the downloads, and — once kitloom/bookings is installed — the appointments. The app names no module: a section another module adds to the site's account page is on the phone at once.</li>
<li><strong>Push</strong>: <em>Your order #1042 is on its way</em> when the owner marks it shipped, in the site's language.</li>
</ul>
<p>The catalogue needs nothing new on the site. Every page of a kitloom site answers as JSON when asked for it, exactly what the site's own Vue, React or Blade theme draws, so a product, a category, a search and the front page are read from their own addresses. The module adds what a phone needs beyond the pages.</p>
<h2 id="the-site-s-side" tabindex="-1">The site's side <a class="header-anchor" href="#the-site-s-side" aria-label="Permalink to &quot;The site's side&quot;">&ZeroWidthSpace;</a></h2>
<p>The admin gets a <strong>Mobile app</strong> section with two screens.</p>
<p><strong>Settings</strong> has the main switch, <em>Serve the app</em>: until it is on, the app's addresses answer <em>not found</em> and no phone is told anything. Under it, the <strong>install links</strong> — the App Store and Google Play links once the app is listed, a public TestFlight link and an APK while it is being tried; the site's theme shows them, the app shows them to nobody. The <strong>App Store id</strong>, with the banner switched on, makes Safari on an iPhone offer the app at the top of every page of the site: one meta tag, no script, no cookie. <strong>Push about orders</strong> tells the customer's phone when the order is placed and whenever its status changes, through Expo's push service, which holds the app's Apple and Google credentials; an access token from Expo's dashboard is optional and kept encrypted. <strong>Oldest app version served</strong> tells an old build to update before it goes on. And <strong>downloadable products</strong> stay off by default: Apple makes an app sell digital goods through its own purchases, so a download is bought on the site, while physical goods and services are paid as on the site.</p>
<p><strong>Devices</strong> lists the phones the app runs on — the name the phone gives itself, iOS or Android, whose it is or <em>A guest</em>, the app's version, when it was last seen. Delete one and it hears nothing more; the app on it keeps working, and a sign-in registers it again.</p>
<p>A sign-in from the app is a sign-in to the site: the same email or login name and password, the same locks against guessing. It mints an <em>application password</em> named after the phone — &quot;Ada's iPhone · Green Pantry&quot; — which the phone keeps as its token and which is listed with the user's other application passwords, on their profile and under REST API, where revoking it signs the phone out. An account protected by a second factor is asked to use the site.</p>
<p>The App Store requires that an app which makes accounts lets the user delete theirs from the app. With kitloom/privacy installed the app files an erasure request for the user's own email, the person confirms it from the email, and the owner erases what the law lets go under <strong>Tools → Erase Personal Data</strong>, where the devices are exported and erased with the rest.</p>
<h2 id="a-store-you-can-try-on-your-phone" tabindex="-1">A store you can try on your phone <a class="header-anchor" href="#a-store-you-can-try-on-your-phone" aria-label="Permalink to &quot;A store you can try on your phone&quot;">&ZeroWidthSpace;</a></h2>
<p>We run one as the stand: <strong>Prairie Hops</strong>, a craft beer shop in Winnipeg, at <a href="https://pantry.kitloom.dev" target="_blank" rel="noreferrer">pantry.kitloom.dev</a>. Twenty-three beers in eight categories, filters by style, strength, format and brewery, delivery in the city for six dollars and free from sixty, pickup at the taproom. Its Android build goes to testers by link and TestFlight follows; the site's <strong>Mobile app → Settings</strong> is where the store links go the day they are public.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>The module mounts <code>app/<wbr>v1</code> under the site's REST root, with WordPress's JSON errors. <code>GET /<wbr>site</code> answers the site's facts in one request: name, icon, currency, the shop's pages, the payment methods, the account's sections, the install links, the minimum version. <code>POST /<wbr>auth/<wbr>sign-<wbr>in</code> runs the login form's own checks — <code>Kitloom\<wbr>Site\<wbr>Auth\<wbr>Password<wbr>Check</code>, extracted from the login controller in this release so a form and an app refuse a password the same way — and answers a Sanctum token from kitloom/api's application passwords. <code>POST /<wbr>cart/<wbr>quote</code> prices the phone's lines with the shop's own <code>Cart</code>, so a coupon or a shipping zone is never written twice, and says per line what cannot be bought. <code>POST /<wbr>checkout</code> is <code>Checkout::<wbr>place<wbr>Order()</code> with the same fields and checks as the site's form. <code>GET /<wbr>account/<wbr>{section}</code> reads whatever is tagged <code>Account<wbr>Section::<wbr>TAG</code>. Push is a queued job per phone through Expo's API, and an hourly command reads the receipts and forgets the phones Apple and Google no longer know.</p>
<p>Octane-safe, every option written through <code>Setting<wbr>Writer</code> with the acting user, the Expo token encrypted and never read back by the form, tests in the package. The app's code is TypeScript on Expo Router, TanStack Query and Zustand, with a test run of its own.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/mobile-apps/filament/settings.jpg" src="https://media.kitloom.dev/lessons/mobile-apps/filament/settings.mp4"></video>
  <figcaption>Mobile app: your store on the phone</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/mobile-apps/filament/devices.jpg" src="https://media.kitloom.dev/lessons/mobile-apps/filament/devices.mp4"></video>
  <figcaption>Mobile app: the phones it runs on</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every route and option of the module is in the <a href="https://kitloom.dev/docs/modules/guides/mobile-apps.html">Mobile app guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Update notifications for a Laravel CMS: know when a security release is out</title>
      <link>https://kitloom.dev/blog/update-notifications-for-a-laravel-cms.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/update-notifications-for-a-laravel-cms.html</guid>
      <pubDate>Fri, 06 Nov 2026 12:00:00 GMT</pubDate>
      <description>A Laravel site installed with Composer has no Dashboard → Updates. kitloom's Updates screen, a badge on the menu and a message in Telegram or Slack say when a newer version is out and whether it fixes a security hole — sending four values, not the site's address.</description>
      <content:encoded><![CDATA[<p>On a WordPress site, a new version announces itself: a number on <strong>Dashboard → Updates</strong>, a red line under a plugin, an email when a security release went in by itself. A Laravel site has none of it. Its code came in through Composer, and the only way to learn that a newer version exists is to run <code>composer outdated</code> or to read a changelog — which nobody does on a site that works. A release that closes a security hole waits on the shelf until someone happens to look.</p>
<p>kitloom is installed the same way, and it keeps Composer in charge of the code: no button rewrites <code>vendor</code> on a live server. What it adds since 1.16.0 is the part WordPress gets right — the site knows, and says so where its administrators look. That is <code>kitloom/<wbr>updates</code>, on every site, in both admins.</p>
<h2 id="what-the-administrators-see" tabindex="-1">What the administrators see <a class="header-anchor" href="#what-the-administrators-see" aria-label="Permalink to &quot;What the administrators see&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>Updates</strong> in the admin: the version the site runs, every release since then with its date, a summary and a link to its entry in the changelog, and the command that takes the site there. A release that fixes a security hole is in red, and so is the page's headline: <em>kitloom 1.17.1 is out and fixes a security hole. You run 1.16.0.</em> A new major version says first which constraint to change in <code>composer.<wbr>json</code>.</li>
<li><strong>A badge</strong> on the menu with the number of releases waiting — red when one of them is a security release. It is read from the cache, so it costs nothing on every page.</li>
<li><strong>Check now</strong>, for the day a release is announced. Otherwise the site asks twice a day on Laravel's schedule, at a minute and an hour of its own; a site without cron asks when an administrator opens the screen and the last answer is a day old.</li>
</ul>
<p>Who sees all this is a permission, <strong>See which kitloom releases are out</strong> — WordPress's <code>update_<wbr>core</code> — which administrators hold. Give it to another role on <strong>Users → Roles</strong>.</p>
<h2 id="a-message-in-telegram-slack-or-email" tabindex="-1">A message in Telegram, Slack or email <a class="header-anchor" href="#a-message-in-telegram-slack-or-email" aria-label="Permalink to &quot;A message in Telegram, Slack or email&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/modules/guides/notifications.html">Notifications</a>, <em>kitloom update</em> is a topic of the owner's channels — Telegram, Slack, Discord, Teams, Pushover, browser push or email — ticked on a new channel. Each release is told once: its version, <em>with a security fix</em> in the title when it has one, what changed, and the command. So a security release reaches whoever looks after the site without anyone opening the admin. Untick it on a channel to see releases only on the screen.</p>
<h2 id="in-the-console-a-ci-job-and-an-ai-agent" tabindex="-1">In the console, a CI job and an AI agent <a class="header-anchor" href="#in-the-console-a-ci-job-and-an-ai-agent" aria-label="Permalink to &quot;In the console, a CI job and an AI agent&quot;">&ZeroWidthSpace;</a></h2>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:updates</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">            # the same as the screen</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:updates</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --refresh</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">  # ask now</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:updates</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --json</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">     # for a script</span></span></code></pre>
</div><p>The command exits with 1 while a security release waits, so a CI pipeline or a cron mail can fail on it. An AI agent connected over MCP reads the version and what waits in <code>describe_<wbr>site</code>; it cannot update the site, which needs Composer on your machine.</p>
<h2 id="what-the-site-sends" tabindex="-1">What the site sends <a class="header-anchor" href="#what-the-site-sends" aria-label="Permalink to &quot;What the site sends&quot;">&ZeroWidthSpace;</a></h2>
<p>A check is one request to <code>updates.<wbr>kitloom.<wbr>dev</code>, with four values in its headers:</p>
<table tabindex="0">
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>kitloom's version</td>
<td><code>1.<wbr>16.<wbr>0</code></td>
</tr>
<tr>
<td>PHP's version, without the patch</td>
<td><code>8.<wbr>4</code></td>
</tr>
<tr>
<td>The edition: the admins the site has</td>
<td><code>Filament</code>, <code>Nova</code>, <code>Both</code>, <code>None</code></td>
</tr>
<tr>
<td>A random id the site made for itself</td>
<td><code>3f6c1a0e-<wbr>…</code></td>
</tr>
</tbody>
</table>
<p>Nothing else: not the site's address, not its modules, themes, users or content. WordPress's own update check names the site in its user agent and sends the list of its plugins; kitloom's does neither. The id is drawn from nothing about the site, so it says only &quot;the same site as last time&quot; and lets kitloom count sites once rather than twice a day. On our side the server keeps no IP address, and an id not heard from for 90 days is deleted — the <a href="https://kitloom.dev/privacy.html#update-checks">privacy policy</a> has the whole of it.</p>
<p>On a closed network, one line in <code>.<wbr>env</code> turns it off, and the screen links to the <a href="https://kitloom.dev/docs/changelog.html">changelog</a> instead:</p>
<div class="language-dotenv vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">dotenv</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">KITLOOM_UPDATE_CHECK</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">false</span></span></code></pre>
</div><p>A server that may not reach out can ask a mirror: <code>KITLOOM_<wbr>UPDATE_<wbr>FEED=https://<wbr>…</code>.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" src="https://media.kitloom.dev/lessons/updates/filament/updates.mp4#t=3"></video>
  <figcaption>The Updates screen: what is out, what changed, and how to update</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Every detail — the switches, the schedule, the mirror, a staging copy with an id of its own — is in the <a href="https://kitloom.dev/docs/modules/guides/updates.html">Updates guide</a>. The rest of kitloom is a click away in a sandbox, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Stop authors saving scripts in Laravel: WordPress's kses, done for a Laravel CMS</title>
      <link>https://kitloom.dev/blog/stop-authors-saving-scripts-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/stop-authors-saving-scripts-in-laravel.html</guid>
      <pubDate>Thu, 05 Nov 2026 12:00:00 GMT</pubDate>
      <description>A Laravel site where authors, contributors or an AI agent write HTML: scripts, event handlers and unsafe links taken out on the save, administrators and editors keeping raw HTML, as WordPress does.</description>
      <content:encoded><![CDATA[<p>A post is HTML, and HTML can run code. On a site with one writer that is fine: you write what you want on your own pages. Once other people write too — authors, contributors, shop staff, a translator, or an AI agent working for any of them — one of them can put a <code>&lt;script&gt;</code> or an <code>onerror=</code> into a post. Nothing happens to them. It runs when an administrator opens that post, with the administrator's session. That is a stored XSS, and the usual way it gets in is not an attacker: it is a paragraph pasted from a newsletter tool or another site, carrying a tracker nobody saw.</p>
<p>WordPress has stopped this for twenty years with a filter called kses. Only users who may write <strong>unfiltered HTML</strong> keep their markup as written; everyone else has it cleaned when they save. A Laravel site that lets several people write usually has nothing of the kind, or a purifier called in one controller and forgotten in the next. <code>kitloom/<wbr>content-<wbr>sanitizer</code> puts the rule where every save passes.</p>
<h2 id="whose-html-is-cleaned" tabindex="-1">Whose HTML is cleaned <a class="header-anchor" href="#whose-html-is-cleaned" aria-label="Permalink to &quot;Whose HTML is cleaned&quot;">&ZeroWidthSpace;</a></h2>
<p>Everyone's except the holders of <strong>Write unfiltered HTML</strong> — WordPress's own <code>unfiltered_<wbr>html</code> capability. As on a single WordPress site, <strong>Administrator</strong> and <strong>Editor</strong> hold it; <strong>Author</strong>, <strong>Contributor</strong>, <strong>Subscriber</strong> and any role you made do not. It is a permission like any other on <strong>Users → Roles</strong>: take it from editors who are freelancers, give it to a role you trust. <strong>Content Sanitizer → Settings</strong> says at the top who holds it now.</p>
<p>What is cleaned is every HTML text a user writes:</p>
<ul>
<li>a post's or a page's content and excerpt, products and any other type included;</li>
<li>a category's, a tag's or any term's description;</li>
<li>a WYSIWYG custom field, at any depth of groups, repeaters and flexible content;</li>
<li>a translation's content and excerpt.</li>
</ul>
<p>The rule sits in the core's writers, not in a screen. So the same holds from the Filament admin, the Nova admin, the REST API, a spreadsheet import and an AI agent connected over MCP. Imports, the demo and console commands write as the site itself, and a WordPress export comes over as it was.</p>
<h2 id="what-stays-and-what-goes" tabindex="-1">What stays and what goes <a class="header-anchor" href="#what-stays-and-what-goes" aria-label="Permalink to &quot;What stays and what goes&quot;">&ZeroWidthSpace;</a></h2>
<p>What a writer needs stays: headings, lists, links, quotes, tables, figures and captions, images with their <code>srcset</code>, video and audio, the block editor's markup with its colours and alignments, shortcodes. Text and entities are kept byte for byte: a clean save changes nothing, so revisions show no difference.</p>
<p>What runs goes: <code>&lt;script&gt;</code>, <code>&lt;style&gt;</code>, forms, <code>&lt;object&gt;</code>, event handlers, attributes a script of the site reads to run something (<code>hx-<wbr>*</code>, <code>x-<wbr>*</code>, <code>data-<wbr>bs-<wbr>*</code>), <code>javascript:</code> and <code>data:</code> addresses however they are hidden, inline styles that load something or lay a box over the page, and frames from any site not on your list. YouTube, Vimeo and Google Maps are on it from the start; a path narrows a host, so <code>www.<wbr>google.<wbr>com/<wbr>maps</code> lets Maps in and nothing else from Google.</p>
<p>The HTML is read by PHP's own HTML5 parser (<code>Dom\<wbr>HTMLDocument</code>, PHP 8.4), the one a browser follows, against a list written from the HTML standard. No outside library, and no regex guessing where a tag ends.</p>
<h2 id="nothing-is-refused" tabindex="-1">Nothing is refused <a class="header-anchor" href="#nothing-is-refused" aria-label="Permalink to &quot;Nothing is refused&quot;">&ZeroWidthSpace;</a></h2>
<p>A save always goes through, without what was removed, and the person is told what went by name: <em>Removed from what you saved, as your role may not store it: script, onclick.</em> An author who pastes from Word can still save. An AI agent gets the same names in its tool's answer, so it can tell its user why the embed it was asked to add did not stay.</p>
<p>Only what a user changed is cleaned. An author who moves your post to another category, or saves a page with your fields untouched, leaves your markup alone.</p>
<h2 id="what-was-there-before" tabindex="-1">What was there before <a class="header-anchor" href="#what-was-there-before" aria-label="Permalink to &quot;What was there before&quot;">&ZeroWidthSpace;</a></h2>
<p>Posts written before the module, or brought over from WordPress, are not touched until someone without the permission saves them. To see what would change, where and whose:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> content-sanitizer:scan</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> content-sanitizer:scan</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --fix</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">   # after a backup</span></span></code></pre>
</div><h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>Two short lessons from the admin, narrated:</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" src="https://media.kitloom.dev/lessons/content-sanitizer/filament/settings.mp4#t=3"></video>
  <figcaption>Content Sanitizer settings: frames, styles, and who keeps raw HTML</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" src="https://media.kitloom.dev/lessons/content-sanitizer/filament/an-authors-save.mp4#t=3"></video>
  <figcaption>An author pastes a script: what goes, and how they are told</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail of the module is in the <a href="https://kitloom.dev/docs/modules/guides/content-sanitizer.html">Content Sanitizer guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>WebP and AVIF images in Laravel, without touching the theme</title>
      <link>https://kitloom.dev/blog/webp-images-in-laravel-without-touching-the-theme.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/webp-images-in-laravel-without-touching-the-theme.html</guid>
      <pubDate>Thu, 05 Nov 2026 12:00:00 GMT</pubDate>
      <description>Serve WebP or AVIF instead of JPEG on a Laravel site: new uploads cut in the format you choose, the existing library converted on the queue, and the files WordPress's Performance Lab plugin made used as they are.</description>
      <content:encoded><![CDATA[<p>The heaviest thing on most pages is the pictures, and most of them are still JPEGs. A WebP of the same photo weighs about a third less, an AVIF about half. Every current browser shows WebP, and Lighthouse asks for modern image formats on almost every site it looks at.</p>
<p>Turning that on in a Laravel site is usually more work than it sounds. You need a copy of every size, not only the original, and a theme that asks for it in a <code>&lt;picture&gt;</code> element or by a new URL. You need a way to convert the thousands of images already uploaded without stopping the site, and old posts that link <code>photo-<wbr>300x200.<wbr>jpg</code> directly must keep working. In WordPress it is a plugin, Performance Lab's &quot;Modern Image Formats&quot;. In kitloom it is one setting.</p>
<h2 id="one-choice-in-settings-→-media" tabindex="-1">One choice in Settings → Media <a class="header-anchor" href="#one-choice-in-settings-→-media" aria-label="Permalink to &quot;One choice in Settings → Media&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Settings → Media → Image format</strong>, in both admins:</p>
<table tabindex="0">
<thead>
<tr>
<th>Choice</th>
<th>What happens</th>
</tr>
</thead>
<tbody>
<tr>
<td>As uploaded</td>
<td>JPEG stays JPEG, PNG stays PNG, as WordPress does.</td>
</tr>
<tr>
<td>WebP</td>
<td>New JPEGs and PNGs get their sizes in WebP, and the image a WebP copy beside it.</td>
</tr>
<tr>
<td>AVIF</td>
<td>The same in AVIF: lighter still, slower to make. Offered only when the server's GD can write it; otherwise greyed, with the reason.</td>
</tr>
</tbody>
</table>
<p>A PNG becomes a lossless WebP, so screenshots keep sharp text. A copy that would weigh more than the original (it happens with small, flat pictures) is not kept. GIFs and WebP uploads stay as they are. The upload itself is never replaced: the editors, downloads and the next regeneration start from it.</p>
<p>A new site starts in WebP. A site that already has images stays as uploaded until you choose: nothing is converted behind your back.</p>
<h2 id="no-theme-changes" tabindex="-1">No theme changes <a class="header-anchor" href="#no-theme-changes" aria-label="Permalink to &quot;No theme changes&quot;">&ZeroWidthSpace;</a></h2>
<p>Every way an image reaches a page gives the file in the chosen format: the featured image, <code>Media::<wbr>url($attachment, 'large')</code>, galleries, widgets, custom fields, the REST API's <code>media_<wbr>details</code>. Images inserted into old posts as <code>wp-<wbr>image-<wbr>123</code> are shown from their copies too. The page is changed as it is drawn, so the post itself stays as it was written and switching back to <em>As uploaded</em> serves the JPEGs again at once.</p>
<h2 id="the-library-you-already-have" tabindex="-1">The library you already have <a class="header-anchor" href="#the-library-you-already-have" aria-label="Permalink to &quot;The library you already have&quot;">&ZeroWidthSpace;</a></h2>
<p>Once WebP is chosen, the settings page counts the images that have no copy yet. <strong>Convert</strong> has the queue's workers cut them again, fifty a job. Pages keep showing the old files until the last image is done; then the page cache is cleared. The JPEG sizes stay on the disk beside the copies, so a post written last year that links one still finds it.</p>
<p>From the console it is one command, here and now or on the queue:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> media:regenerate</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --format=webp</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> media:regenerate</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --format=webp</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --queue</span></span></code></pre>
</div><p>An AI agent connected to the site can do the same for a few images with <code>media_<wbr>regenerate</code>, and <code>describe_<wbr>site</code> tells it which format is served and how many images wait.</p>
<h2 id="coming-from-wordpress" tabindex="-1">Coming from WordPress <a class="header-anchor" href="#coming-from-wordpress" aria-label="Permalink to &quot;Coming from WordPress&quot;">&ZeroWidthSpace;</a></h2>
<p>The files are named and recorded the way Performance Lab names and records them: <code>photo-<wbr>jpg.<wbr>webp</code> beside <code>photo.<wbr>jpg</code>, <code>photo-<wbr>300x200-<wbr>jpg.<wbr>webp</code> for a size, and every format kept listed under <code>sources</code> in <code>_<wbr>wp_<wbr>attachment_<wbr>metadata</code>. A WordPress site that ran the plugin is served its WebP files the moment it is moved, with nothing to convert. Moving to kitloom does not undo the work the old site already did.</p>
<h2 id="lighter-still" tabindex="-1">Lighter still <a class="header-anchor" href="#lighter-still" aria-label="Permalink to &quot;Lighter still&quot;">&ZeroWidthSpace;</a></h2>
<p><a href="https://kitloom.dev/docs/modules/guides/media-optimizer.html">Media Optimizer</a> then squeezes the files the site writes through <code>jpegoptim</code>, <code>pngquant</code>, <code>cwebp</code> and the like where the server has them, the lossy WebP copies included.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" src="https://media.kitloom.dev/lessons/media/filament/settings.mp4#t=3"></video>
  <figcaption>Media settings: image sizes, WebP and the images already uploaded</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. What the server needs for AVIF is in the <a href="https://kitloom.dev/docs/deployment.html#what-the-server-needs">Deployment guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Composer cooldown in a Laravel project: what it protects, and the week it breaks installs</title>
      <link>https://kitloom.dev/blog/composer-cooldown-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/composer-cooldown-in-laravel.html</guid>
      <pubDate>Wed, 04 Nov 2026 12:00:00 GMT</pubDate>
      <description>Composer 2.11 can hold new package versions back for a week against supply-chain attacks. kitloom's test applications run with it; new sites don't, because a security fix plus a cooldown can leave Laravel with nothing to install. Here is why, and how to turn it on.</description>
      <content:encoded><![CDATA[<p>A Laravel site runs on a few hundred packages it never chose one by one. Each of them is somebody's account on Packagist or GitHub, and an account can be taken over. Whoever gets in publishes a new version, and every project that runs <code>composer update</code> before it is noticed installs it. What such a version does first is predictable: it reads <code>.<wbr>env</code>. On a kitloom site that file holds the database password, the application key and the keys of the payment, mail and storage services.</p>
<p>This has happened again and again. In September 2025 a phished maintainer put malicious versions of <code>chalk</code> and <code>debug</code> on npm, packages with billions of weekly downloads between them; the bad versions were gone within hours. PHP's ecosystem has had its own hijacked packages. The pattern is the same each time: the bad version is found fast, so the damage is done in the first hours and days.</p>
<h2 id="what-a-cooldown-does" tabindex="-1">What a cooldown does <a class="header-anchor" href="#what-a-cooldown-does" aria-label="Permalink to &quot;What a cooldown does&quot;">&ZeroWidthSpace;</a></h2>
<p>Composer 2.11 adds a policy for exactly that window. In <code>composer.<wbr>json</code>:</p>
<div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"config"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    "policy"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">        "cooldown"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">            "period"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"7 days"</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>From then on <code>composer update</code> and <code>composer require</code> pass over every version younger than a week, and <code>composer outdated</code> tells you what is waiting. <code>composer install</code> is not touched: it installs what <code>composer.<wbr>lock</code> holds, so a server that deploys a committed lock behaves as before. The protection sits where versions are chosen, on your machine.</p>
<h2 id="what-we-turned-on" tabindex="-1">What we turned on <a class="header-anchor" href="#what-we-turned-on" aria-label="Permalink to &quot;What we turned on&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom is tested in two applications, one per admin, that run every package's tests together. They are also where we pick up new versions of Laravel, Filament, Symfony and the rest, so they are where a hijacked release would reach us first. Both now run with a week's cooldown. As this post is written, a full <code>composer update</code> there holds back 187 versions that are not a week old yet.</p>
<p>A cooldown needs to know when each version was published, and it has to be a time the repository vouches for. Packagist gives one for every version, <code>published-<wbr>time</code>. The package's own <code>time</code> won't do: it comes from git, and whoever pushes the code sets it.</p>
<p>Our own repository, packages.kitloom.dev, is built with Satis, which writes no <code>published-<wbr>time</code> at all. Its <code>time</code> was no substitute either: for kitloom's packages it is the date of the last commit to each package, so a package that did not change between three releases showed the same date for all three. So the build now stamps every release with the moment it first offered it, kept on our side between builds — the releases before that, with the date of their tag. Composer 2.11 counts from it like from Packagist's: a site with a week's cooldown and nothing ignored gets the newest kitloom release that is a week old.</p>
<p>Nova's repository gives no time, and for a version without one Composer stops and names the package. So Nova goes under <code>ignore</code> and comes in the day it is released — a trade we make knowingly. The test applications ignore kitloom's packages too: there they come from the repository they are written in, not from a download.</p>
<h2 id="the-week-it-would-have-broken-every-new-site" tabindex="-1">The week it would have broken every new site <a class="header-anchor" href="#the-week-it-would-have-broken-every-new-site" aria-label="Permalink to &quot;The week it would have broken every new site&quot;">&ZeroWidthSpace;</a></h2>
<p>The obvious next step was to put the same lines into the starters that <code>laravel new --<wbr>using=kitloom/<wbr>filament-<wbr>starter</code> installs from. Before shipping it, we tried a clean install with the cooldown on. It failed.</p>
<p>On 28 October an advisory came out for <code>symfony/<wbr>mime</code>, which Laravel requires: CVE-2026-45070, an email header injection. Symfony published the fixed releases, v7.4.22 and v8.1.10, the same day. Composer refuses versions with a known advisory, so every older release was out at once. The fixed ones were less than a week old, so the cooldown held them back. Between the two rules no version of <code>symfony/<wbr>mime</code> was left, and Laravel could not be resolved at all — for a full week, until the fix was seven days old.</p>
<p>That is not a corner case. It happens after every security release of a package everything depends on, and those are exactly the releases you want fastest. A project with a lock file mostly doesn't notice: its locked version stays, and you can take the fix by name with <code>composer update symfony/<wbr>mime --<wbr>no-<wbr>cooldown</code>. A new project has no lock file. Anyone who bought kitloom that week would have seen their first command fail.</p>
<p>So the starters stay without a cooldown, and the publishing script strips the policy from the copy that goes out.</p>
<h2 id="your-site-your-choice" tabindex="-1">Your site, your choice <a class="header-anchor" href="#your-site-your-choice" aria-label="Permalink to &quot;Your site, your choice&quot;">&ZeroWidthSpace;</a></h2>
<p>A site that runs <code>composer update</code> regularly is in a different position from a fresh install, and for most of them a cooldown is worth having. The <a href="https://kitloom.dev/docs/deployment.html#holding-new-versions-back">Deployment guide</a> shows the lines to add, and what they cost:</p>
<ul>
<li>after a security release, <code>composer update</code> can fail until you take the fix by name;</li>
<li>fixes come a week later unless you take them by name, so watch <code>composer audit</code>;</li>
<li>Nova is not covered, and kitloom's packages wait a week as well unless you ignore them;</li>
<li>Composer older than 2.11 ignores the setting without a word, on your machine and in CI;</li>
<li>a version that hides its harm for longer than the period still gets in.</li>
</ul>
<p>None of this replaces reading what you update. It narrows the window in which almost every hijacked release so far has been caught, at the price of a command you sometimes have to type by hand.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. How updates reach a live kitloom site, with the cooldown and without, is in the <a href="https://kitloom.dev/docs/deployment.html#updates">Deployment guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>A beer store on Laravel, delivered by Uber: age gate, deposits and a courier at the door</title>
      <link>https://kitloom.dev/blog/beer-store-on-laravel-delivered-by-uber.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/beer-store-on-laravel-delivered-by-uber.html</guid>
      <pubDate>Tue, 03 Nov 2026 12:00:00 GMT</pubDate>
      <description>An online beer store on Laravel that checks the customer's age on the site, at checkout and at the door — the courier from Uber Direct asks for an ID — with container deposits by the pack, the hours the licence allows, and a store underneath that any shop could use: products with variants, a cart, a checkout with taxes and delivery zones, orders and a delivery board, run from the admin or by an AI agent.</description>
      <content:encoded><![CDATA[<p>A beer store that delivers has three questions a shoe shop never asks. Is the person ordering old enough, and is the person opening the door the same one? When may a van or a courier bring beer at all — the licence says ten to ten, not when the customer would like it? And what does a six-pack cost once the deposit on the cans is on the bill, taxed or not, as the province says? The shop itself — products, a cart, a checkout, orders — is ninety percent of the work and the same work as everywhere; the beer is the last ten, and it is the ten that gets a store fined.</p>
<p>kitloom answers it with two modules. <code>kitloom/<wbr>store</code> is the shop: a Laravel-first store with tables of its own, built for a new site rather than one that came from WooCommerce. <code>kitloom/<wbr>beer-<wbr>store</code> is the vertical on top of it: what a beer is beyond a product, the age at every door, the deposits, the hours, and Uber Direct as the courier — with an ID check at the door written into the delivery. The admin is Filament or Nova; the theme that comes with it, Taproom, is a Vue storefront with the age gate over every page.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent runs the store with the rights of the user whose key it holds:</p>
<ul>
<li><em>&quot;Add Harbour Wit, a witbier from Harbour &amp; Hop: five percent, 473 millilitre cans, sold as a single and a six-pack at 4.25 and 22.&quot;</em> (<code>store_<wbr>products_<wbr>save</code>, with <code>data</code> for the ABV and the container and <code>terms</code> for the style and the brewery)</li>
<li><em>&quot;Which orders are waiting to be packed?&quot;</em> (<code>store_<wbr>orders_<wbr>list</code>)</li>
<li><em>&quot;Order 1042 is packed — mark it ready.&quot;</em> (<code>store_<wbr>orders_<wbr>update_<wbr>status</code>; the courier is called by it)</li>
<li><em>&quot;Tell the customer of 1042 the keg comes at six, not four.&quot;</em> (<code>store_<wbr>orders_<wbr>add_<wbr>note</code>, sent to the customer)</li>
<li><em>&quot;The driver could not find 1038 — put the delivery back on the board for tomorrow.&quot;</em> (<code>store_<wbr>deliveries_<wbr>update</code>)</li>
</ul>
<p>Every tool calls the same service the admin's button does, as the agent's user, so the order's history names who did what. Nothing is deleted: a product is made unsellable, an order is cancelled, a delivery is called off. <code>describe_<wbr>site</code> tells the agent the store's statuses, the couriers it has, and the beer's fields and taxonomies, so it writes a beer as the owner would.</p>
<h2 id="the-age-at-every-door" tabindex="-1">The age, at every door <a class="header-anchor" href="#the-age-at-every-door" aria-label="Permalink to &quot;The age, at every door&quot;">&ZeroWidthSpace;</a></h2>
<p>Selling alcohol online is three checks, and the module makes all three one setting: <strong>Minimum age</strong>, eighteen in Manitoba, Quebec and Alberta, nineteen elsewhere in Canada, twenty-one in the US.</p>
<ul>
<li><strong>On the site</strong>, an age gate: every page asks &quot;Are you 18 or older?&quot; before it shows anything. The theme draws it in the browser and keeps the answer in a cookie, because the page cache keeps one page for everyone; <em>No</em> sends the visitor to the exit address, Google by default.</li>
<li><strong>At the checkout</strong>, the date of birth, asked when the cart holds anything with a minimum age and refused under it. The order keeps it.</li>
<li><strong>At the door</strong>, the delivery carries what the courier must do before handing over — an ID for the minimum age, a signature, a photo — and a courier called by API gets it as its verification. A beer that nobody of age signs for comes back, and the owner is told: <em>ID refused at the door for order 1042</em>, in Telegram, Slack or by email with <a href="https://kitloom.dev/docs/modules/guides/notifications.html">kitloom/notifications</a>.</li>
</ul>
<p>A beer starts at the minimum age the moment it has a container or a strength; a glass or a tote on the same shelf is for anyone.</p>
<h2 id="what-a-beer-is" tabindex="-1">What a beer is <a class="header-anchor" href="#what-a-beer-is" aria-label="Permalink to &quot;What a beer is&quot;">&ZeroWidthSpace;</a></h2>
<p>A beer is a product of the store with a box of its own on the form, <em>Details</em>: the alcohol by volume, the bitterness in IBU, the volume of one container, and what the container is — a can, a bottle, a keg, a growler. Its <strong>style</strong> and <strong>brewery</strong> are taxonomies of the product type with pages of their own, <code>/<wbr>store/<wbr>style/<wbr>ipa/</code> and <code>/<wbr>store/<wbr>brewery/<wbr>north-<wbr>fork/</code>, drawn by the catalogue like a category. A beer sold by the pack is a variable product with the option <em>Pack</em> and a variant per size, each with its own price and stock. With <a href="https://kitloom.dev/docs/modules/guides/inventory.html">kitloom/inventory</a> the product page shows the best-before date of the lot on the shelf.</p>
<p><strong>Deposits</strong> are a table the owner edits: one row per kind of container, the amount per container, the tax class the province taxes it by — zero in Manitoba. A six-pack of cans carries six deposits beside its price, as a line of its own on the order, the receipt and the emails, never discounted by a coupon, so the refund with the empties is one line to find.</p>
<p><strong>Hours</strong> are the licence's: per weekday, ten to twenty-two, a day left empty closed. A delivery window the customer picks outside them is refused at the checkout with the hours in the message, an order placed while closed without a window too, and Uber is not asked for a quote outside them.</p>
<h2 id="uber-direct-at-the-door" tabindex="-1">Uber Direct at the door <a class="header-anchor" href="#uber-direct-at-the-door" aria-label="Permalink to &quot;Uber Direct at the door&quot;">&ZeroWidthSpace;</a></h2>
<p>Uber Direct is the courier: a method of the delivery zone, like a flat rate or pickup, and a courier the store calls by API. At the checkout, once the customer's city or postcode is known, Uber quotes the fee and the time — plus the markup the owner adds — and the customer picks it beside the store's own ways. When the order is <em>ready</em> (or <em>paid</em>, as the store's <em>Call the courier</em> setting says) the delivery is made at Uber: meet at the door, bring it back when nobody of age is there, the ID and the signature as the delivery requires. Uber's webhooks move it on the board — scheduled, picked up, on the way, delivered, which completes the order — and a status missed by a webhook is asked for every fifteen minutes.</p>
<p>Setting it up is the Customer ID, Client ID and Secret from the Uber Direct dashboard and the webhook's signing key, on the Beer Store settings page; the secret and the key are kept encrypted and never shown again, and <em>Check Uber access</em> asks Uber with what is saved. <em>Test mode</em> runs the deliveries with Uber's robot courier, so the whole flow is tried before a real van moves.</p>
<h2 id="the-store-underneath" tabindex="-1">The store underneath <a class="header-anchor" href="#the-store-underneath" aria-label="Permalink to &quot;The store underneath&quot;">&ZeroWidthSpace;</a></h2>
<p><code>kitloom/<wbr>store</code> is a Laravel package that happens to be a shop, not a WooCommerce in Laravel. It is for a new site; a site that comes from WordPress keeps <a href="https://kitloom.dev/docs/modules/guides/shop.html">kitloom/shop</a>, which reads WooCommerce's data as it is.</p>
<ul>
<li><strong>Products</strong> are pages of the site — SEO, search, revisions, translations and custom fields work as on any page — with their sale half in two tables: the product's row (kind, tax class, unit, flags, the minimum age, the sale window, the options) and a variant per thing sold (SKU, price, stock, measures, a picture).</li>
<li><strong>The cart and the checkout</strong> are pages of the store's own, <code>/<wbr>cart/</code> and <code>/<wbr>checkout/</code>, with no WordPress page behind them; a theme draws them from their parts. The cart is a table — a customer's by their account, a guest's by a token, joined on sign-in.</li>
<li><strong>Taxes</strong> are rates by name for a country, a region and a postcode pattern, on tax classes, applied in order, compound or not, at the delivery address — a pickup at the store. <strong>Delivery zones</strong> are places with their ways: a flat rate, free over an amount, pickup, the store's own driver, and the couriers the modules add. <strong>Coupons</strong> take a percent, an amount or the delivery off.</li>
<li><strong>Orders</strong> go pending, paid, preparing, ready, completed; cancelled, refunded or failed on the side. The stock is held from the moment an order is placed, given back when it is cancelled, taken for good when it completes. Payment is <a href="https://kitloom.dev/docs/modules/guides/payments.html">kitloom/payments</a>: Stripe, PayPal, Mollie, Square or an offline method; a declined payment fails the order, an abandoned one cancels it. The customer hears of every step by email, and by text with <a href="https://kitloom.dev/docs/modules/guides/text-messages.html">kitloom/text-messages</a>; a paid order gets its receipt as a PDF.</li>
<li><strong>Deliveries</strong> are one row per order: the way, the window, the address or the pickup place, the courier's id and tracking link, what must be checked at the door. The board shows the day's work by tab — open, today, on the way, pickups — and moves a delivery by hand where no courier does.</li>
<li><strong>The customer's account</strong> gets <em>Orders</em> and <em>Addresses</em>; a visitor's own AI assistant gets <code>store_<wbr>search</code>, <code>store_<wbr>product</code> and <code>store_<wbr>cart_<wbr>link</code> through <a href="https://kitloom.dev/docs/modules/guides/public-agents.html">kitloom/public-agents</a>, so Claude can fill a cart for them.</li>
</ul>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>Everything is contracts and tags, so the beer store names nothing in the core and the core names no beer:</p>
<ul>
<li><code>Kitloom\<wbr>Store\<wbr>Contracts\<wbr>Product<wbr>Extension</code> — a vertical's fields on a product (kept in the product's <code>data</code>, drawn under <em>Details</em> by both admins, exported by the sheet, on the <code>store<wbr>Product</code> part), its taxonomies, the defaults of its own products, the rows on the page.</li>
<li><code>Kitloom\<wbr>Store\<wbr>Contracts\<wbr>Line<wbr>Extras</code> — an amount beside a line's price: the deposit is one.</li>
<li><code>Kitloom\<wbr>Store\<wbr>Contracts\<wbr>Checkout<wbr>Step</code> — fields the checkout asks, their rules, what they write on the order and on the delivery: the date of birth and the hours.</li>
<li><code>Kitloom\<wbr>Store\<wbr>Contracts\<wbr>Shipping<wbr>Method</code> and <code>Courier</code> — a way of delivering that quotes a fee, and the courier that carries it: Uber Direct is a class of each, on Laravel's HTTP client with client credentials, nothing more.</li>
</ul>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// A beer, written as the admin's form or an agent writes it.</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">app</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">\Kitloom\Store\Products\ProductWriter</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">    'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Harbour Wit'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'status'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'publish'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'kind'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'variable'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">    'data'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'abv'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 5.0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'volume'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 473</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'container'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'can'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">],</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">    'attributes'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'name'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Pack'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'values'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'1'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'6'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]]],</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">    'variants'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'sku'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'HH-WIT-1'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'values'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Pack'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> '1'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'price'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> '4.25'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'stock'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 40</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">],</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'sku'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'HH-WIT-6'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'values'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Pack'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> '6'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'price'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> '22.00'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'stock'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 15</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">],</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    ],</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], $user, [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'beer_style'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [$wheat</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">term_id], </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'beer_brewery'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [$harbour</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">term_id]]);</span></span></code></pre>
</div><p>Prices are decimals in the calls and minor units in the tables; every write takes the acting user; the notices, webhooks (<code>store.<wbr>order.<wbr>placed</code>, <code>store.<wbr>delivery.<wbr>status</code>), the sheets, the privacy exporter and the agent tools are all tagged, so each is optional. The next vertical — a cannabis store with its own limits per order — is the same four contracts again.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/store/filament/products.jpg" src="https://media.kitloom.dev/lessons/store/filament/products.mp4"></video>
  <figcaption>Products: prices, stock and variants</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/store/filament/orders.jpg" src="https://media.kitloom.dev/lessons/store/filament/orders.mp4"></video>
  <figcaption>Orders: from pending to ready</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/store/filament/deliveries.jpg" src="https://media.kitloom.dev/lessons/store/filament/deliveries.mp4"></video>
  <figcaption>Deliveries: the board from ready to delivered</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/store/filament/zones-taxes-coupons.jpg" src="https://media.kitloom.dev/lessons/store/filament/zones-taxes-coupons.mp4"></video>
  <figcaption>Delivery zones, tax rates and coupons</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/store/filament/settings.jpg" src="https://media.kitloom.dev/lessons/store/filament/settings.mp4"></video>
  <figcaption>Store settings: currency, checkout, orders</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/beer-store/filament/beers-and-deposits.jpg" src="https://media.kitloom.dev/lessons/beer-store/filament/beers-and-deposits.mp4"></video>
  <figcaption>Beers and deposits</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/beer-store/filament/settings.jpg" src="https://media.kitloom.dev/lessons/beer-store/filament/settings.mp4"></video>
  <figcaption>Age, hours and the door: the beer store settings</figcaption>
</figure>
</div>
<h2 id="install-it" tabindex="-1">Install it <a class="header-anchor" href="#install-it" aria-label="Permalink to &quot;Install it&quot;">&ZeroWidthSpace;</a></h2>
<p>Both modules come with kitloom, for either admin. On a new Filament site:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/store</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/store-filament</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/beer-store</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/beer-store-filament</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/taproom-theme</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> migrate</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> beer-store:demo</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> site:theme</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> Taproom</span></span></code></pre>
</div><p>On a Nova site the admin packages end in <code>-<wbr>nova</code>. The demo fills the shelf — five styles, four breweries, a dozen beers by the pack, the deposits, the hours, Uber Direct on the zone, orders in every status — so the store looks lived in before the first real beer is typed. Every detail is in the guides: <a href="https://kitloom.dev/docs/modules/guides/store.html">Store</a>, <a href="https://kitloom.dev/docs/modules/guides/beer-store.html">Beer Store</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Inventory management for a Laravel shop: warehouses, purchase orders and shipments</title>
      <link>https://kitloom.dev/blog/inventory-management-for-a-laravel-shop.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/inventory-management-for-a-laravel-shop.html</guid>
      <pubDate>Mon, 02 Nov 2026 12:00:00 GMT</pubDate>
      <description>Stock per warehouse and shelf as a ledger of moves, orders that hold their units until they ship, lots that expire, purchase orders emailed as a PDF and received into stock, parcels with tracking — three kitloom modules on a Laravel shop, run from the admin or by an AI agent.</description>
      <content:encoded><![CDATA[<p>A shop that sells from a real shelf asks questions one number per product cannot answer. How many of these are promised to orders that have not shipped yet? Which of the two warehouses has them? What did the last batch cost, and when does it expire? What should we buy this week, from whom, and has it already been ordered? Which parcel did the customer's second box go in?</p>
<p>WooCommerce keeps a stock quantity on the product, and the rest lives in a spreadsheet, in someone's head, or in a second system, Odoo or an ERP, that has to be told about every order. A Laravel rebuild usually inherits the same single number. kitloom adds three modules on top of its shop that answer those questions where the orders are, from the admin, and let an AI agent answer them too.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent works on the stock with the rights of the user whose key it holds:</p>
<ul>
<li><em>&quot;How many Medjool dates do we have, and how many are reserved?&quot;</em> (<code>inventory_<wbr>levels</code>)</li>
<li><em>&quot;We found a case of almonds behind the pallets. Add twelve, reason found.&quot;</em> (<code>inventory_<wbr>adjust</code>)</li>
<li><em>&quot;What should we reorder this week?&quot;</em> (<code>purchasing_<wbr>replenishment</code>)</li>
<li><em>&quot;Draft an order to Valley Nut Growers for forty pistachios and confirm it.&quot;</em> (<code>purchasing_<wbr>order_<wbr>create</code>, <code>purchasing_<wbr>order_<wbr>confirm</code>)</li>
<li><em>&quot;Ship order 1042 with UPS, tracking 1Z999AA10123456784.&quot;</em> (<code>shipments_<wbr>create</code>)</li>
</ul>
<p>Every tool calls the same service the admin's button does, with the agent's user as the actor, so each move in the ledger says who made it. Nothing is deleted: a count or an adjustment corrects a number, a draft is cancelled, a parcel that came back is marked returned. Emailing a purchase order to the supplier stays with a person in the admin.</p>
<h2 id="a-ledger-not-a-number" tabindex="-1">A ledger, not a number <a class="header-anchor" href="#a-ledger-not-a-number" aria-label="Permalink to &quot;A ledger, not a number&quot;">&ZeroWidthSpace;</a></h2>
<p><code>kitloom/<wbr>inventory</code> keeps stock the way a warehouse does. There are <strong>locations</strong>, a warehouse and the shelves in it, a second store, a van, and three virtual ones for the suppliers, the customers and the adjustments. Every unit that changes hands is a <strong>move</strong> from one location to another, and the moves hang on <strong>transfers</strong>: a receipt from a supplier, a delivery to a customer, an internal move, an adjustment from a count. What a location holds is the sum of its moves, never a number someone typed, and the ledger can be rebuilt from them.</p>
<p>The shop's orders go through it without anyone noticing:</p>
<ul>
<li>An order placed <strong>reserves</strong> its units: they stay on the shelf and are nobody else's. Paying changes nothing. The order shipped, or completed, moves them to the customers' location. Cancelled, it lets them go, and an order cancelled after it shipped takes them back on a receipt. A pending order that is never paid holds its units for as long as the shop's <em>Hold stock</em> says.</li>
<li>The product's stock in the catalogue is what is <strong>available online</strong>: on hand less reserved, over the warehouses that sell online. It is written into the product after every move, so the storefront, the feeds and an export read it as before, and on the product form the number is read-only, changed here with a reason and a person behind it.</li>
<li><strong>Backorders</strong> stay the product's choice. A product that allows them is sold past its stock, and the next receipt fills the reservation.</li>
</ul>
<p>A product becomes an item of the warehouse the first time the warehouse hears of it, with the quantity it had as the opening count, or all at once with <code>inventory:<wbr>import-<wbr>products</code>. Nothing is lost on the way, and a shop that does not install the module keeps its one number per product, as it always did.</p>
<h2 id="counts-cost-and-reorder-points" tabindex="-1">Counts, cost and reorder points <a class="header-anchor" href="#counts-cost-and-reorder-points" aria-label="Permalink to &quot;Counts, cost and reorder points&quot;">&ZeroWidthSpace;</a></h2>
<p>Each item carries a unit, so a count can say twelve and a half kilos, a barcode, a reorder point with the quantity to buy, and its <strong>average cost</strong>, moved by every receipt at a price. <strong>Inventory → Counts</strong> takes a location, lists what the records say and the differences become one adjustment with a line per item. <strong>Reports</strong> show on hand by location, the stock's value at average cost, and the items at or under their reorder point, counting what is already on its way.</p>
<h2 id="lots-that-expire-boxes-and-labels" tabindex="-1">Lots that expire, boxes and labels <a class="header-anchor" href="#lots-that-expire-boxes-and-labels" aria-label="Permalink to &quot;Lots that expire, boxes and labels&quot;">&ZeroWidthSpace;</a></h2>
<p>Food, cosmetics, medicine: what expires is bought in batches, and the batch is on the label. An item tracked <strong>by lot</strong> takes a lot number and an expiry day on every receipt line. An order takes the lot that expires first; a count goes lot by lot; a report and a daily notice list the lots that expire within the days you set.</p>
<p>A <strong>packaging</strong> is the box the item comes in, <em>Case of 24</em>, with the barcode printed on the case: scanning it on a receipt or a count stands for the whole box. <strong>Print labels</strong> makes a PDF of Code 128 labels with the SKU and the name, which any scanner reads back.</p>
<h2 id="buying-suppliers-and-purchase-orders" tabindex="-1">Buying: suppliers and purchase orders <a class="header-anchor" href="#buying-suppliers-and-purchase-orders" aria-label="Permalink to &quot;Buying: suppliers and purchase orders&quot;">&ZeroWidthSpace;</a></h2>
<p><code>kitloom/<wbr>purchasing</code> keeps the suppliers you buy from, the people there, and what each sells you at what price, in what smallest quantity, with what lead time. A <strong>purchase order</strong> is drafted with its lines, emailed to the supplier as a PDF, confirmed, which readies a receipt in the warehouse so the goods count as incoming, and received when they come, all at once or a box at a time, at the order's price. A delivery that came short leaves the rest expected on a new receipt.</p>
<p><strong>Replenishment</strong> lists every item at or under its reorder point, with what is on its way subtracted, how many to order, and the supplier it is bought from at their price. Tick the lines and one draft per supplier is made. Every morning the same list reaches you as one notice, with <a href="https://kitloom.dev/docs/modules/guides/notifications.html">kitloom/notifications</a>.</p>
<h2 id="shipping-parcels-with-a-tracking-number" tabindex="-1">Shipping: parcels with a tracking number <a class="header-anchor" href="#shipping-parcels-with-a-tracking-number" aria-label="Permalink to &quot;Shipping: parcels with a tracking number&quot;">&ZeroWidthSpace;</a></h2>
<p><code>kitloom/<wbr>shipments</code> ships an order in one parcel or several. From the order's page, <strong>Ship</strong> lists the lines still to ship, takes all of them or some, the carrier and the tracking number; the carrier's tracking page fills in from the number. Shipping a draft moves the units out of the warehouse, writes a note on the order, emails the customer the tracking link, texts it when the site texts (<a href="https://kitloom.dev/docs/modules/guides/text-messages.html">kitloom/text-messages</a>), and completes the order when its last unit has left. The customer sees every parcel on the order in their account, in every shop theme, with the tracking number linked to the carrier's page.</p>
<p>Ten common carriers come with it, Canada Post, UPS, FedEx, DHL, USPS, Royal Mail, DPD, GLS, Nova Poshta and Ukrposhta; your own is a name and an address with <code>{number}</code> in it. The module works on a shop without the warehouse too: the units then leave the shop's own stock number.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>The three modules are Laravel packages with tables of their own, Eloquent models you can swap in the <code>Model<wbr>Registry</code>, migrations, events (<code>Purchase<wbr>Order<wbr>Confirmed</code>, <code>Shipment<wbr>Shipped</code>, …), queued notifications and both admins, Filament and Nova. They meet the shop through two small contracts, so nothing in the shop names them:</p>
<ul>
<li><code>Kitloom\<wbr>Shop\<wbr>Contracts\<wbr>Stock<wbr>Ledger</code> — <code>reserve</code>, <code>release</code>, <code>fulfil</code>, <code>move<wbr>Line</code>. The shop binds its own ledger over the product's stock number; the warehouse binds its own when installed.</li>
<li><code>Kitloom\<wbr>Shop\<wbr>Contracts\<wbr>Order<wbr>Extra</code> — a block the customer sees on their order, which the themes draw without knowing what it is. Shipments is one.</li>
</ul>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$transfers </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> app</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">\Kitloom\Inventory\Transfers</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$receipt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $transfers</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">receive</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($warehouse, [</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'item'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $item, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'quantity'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 24</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'unit_cost'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 3.10</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'lot_number'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'L-2411'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'expires_at'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> '2027-03-01'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">],</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'note'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Delivery of 2 November'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], $user);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$shipment </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> app</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">\Kitloom\Shipments\Shipments</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($order, $lines, [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'carrier_id'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $ups</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">id, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'tracking_number'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> '1Z999AA10123456784'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], $user);</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">app</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">\Kitloom\Shipments\Shipments</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">ship</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($shipment, $user);</span></span></code></pre>
</div><p>Quantities are decimals with three places, dates are UTC, every write takes the acting user, and the ledger is the only writer of the levels: <code>inventory:<wbr>rebuild --<wbr>check</code> compares the two, and <a href="https://kitloom.dev/docs/modules/guides/health.html">kitloom/health</a> runs the same check. With <a href="https://kitloom.dev/docs/modules/guides/spreadsheets.html">kitloom/spreadsheets</a> the items, levels, moves, suppliers and price lists go out as CSV or Excel and come back in, and a count sheet comes in as adjustments. <a href="https://kitloom.dev/docs/modules/guides/webhooks.html">kitloom/webhooks</a> tells other systems about <code>inventory.<wbr>level.<wbr>changed</code>, <code>purchase_<wbr>order.<wbr>received</code> and <code>shipment.<wbr>shipped</code>.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/inventory/filament/items.jpg" src="https://media.kitloom.dev/lessons/inventory/filament/items.mp4"></video>
  <figcaption>Items, locations and an adjustment</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/inventory/filament/transfers.jpg" src="https://media.kitloom.dev/lessons/inventory/filament/transfers.mp4"></video>
  <figcaption>Receipts and deliveries: how stock moves</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/inventory/filament/counts.jpg" src="https://media.kitloom.dev/lessons/inventory/filament/counts.mp4"></video>
  <figcaption>Counting a shelf, and the reports</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/inventory/filament/lots.jpg" src="https://media.kitloom.dev/lessons/inventory/filament/lots.mp4"></video>
  <figcaption>Lots that expire, boxes and labels</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/purchasing/filament/suppliers.jpg" src="https://media.kitloom.dev/lessons/purchasing/filament/suppliers.mp4"></video>
  <figcaption>Suppliers and their prices</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/purchasing/filament/purchase-orders.jpg" src="https://media.kitloom.dev/lessons/purchasing/filament/purchase-orders.mp4"></video>
  <figcaption>A purchase order, from draft to received</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/purchasing/filament/replenishment.jpg" src="https://media.kitloom.dev/lessons/purchasing/filament/replenishment.mp4"></video>
  <figcaption>What to reorder, in one click</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/shipments/filament/ship-an-order.jpg" src="https://media.kitloom.dev/lessons/shipments/filament/ship-an-order.mp4"></video>
  <figcaption>Ship an order with a tracking number</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/shipments/filament/carriers.jpg" src="https://media.kitloom.dev/lessons/shipments/filament/carriers.mp4"></video>
  <figcaption>Carriers, tracking links and the settings</figcaption>
</figure>
</div>
<h2 id="install-it" tabindex="-1">Install it <a class="header-anchor" href="#install-it" aria-label="Permalink to &quot;Install it&quot;">&ZeroWidthSpace;</a></h2>
<p>The modules come with kitloom, for either admin, and each is optional: the warehouse alone, the warehouse with purchasing, shipments with or without the warehouse. On a Filament site with the shop:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/inventory</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/inventory-filament</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/purchasing</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/purchasing-filament</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/shipments</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/shipments-filament</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> migrate</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> inventory:import-products</span></span></code></pre>
</div><p>On a Nova site the admin packages end in <code>-<wbr>nova</code>. The last command makes an item of every product that manages its stock, with its quantity as the opening count; a shop that sold nothing yet can skip it. Every detail is in the guides: <a href="https://kitloom.dev/docs/modules/guides/inventory.html">Inventory</a>, <a href="https://kitloom.dev/docs/modules/guides/purchasing.html">Purchasing</a>, <a href="https://kitloom.dev/docs/modules/guides/shipments.html">Shipments</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Browser push notifications for your site's admin, with no app to install</title>
      <link>https://kitloom.dev/blog/browser-push-notifications-for-a-laravel-admin.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/browser-push-notifications-for-a-laravel-admin.html</guid>
      <pubDate>Sun, 01 Nov 2026 12:00:00 GMT</pubDate>
      <description>A new order, a booking request or a failed backup as a notification on the owner's phone or computer, from a Laravel site through web push: one channel per browser, turned on with a tap, signed with the site's own VAPID keys.</description>
      <content:encoded><![CDATA[<p>The owner of a small shop does not sit in the admin. They hear of a new order from an email, if they open it, and of a failed backup from nobody. What they do look at, a hundred times a day, is the phone's lock screen. Getting the site there used to mean an app: a native one to build and publish, or a third party's app with an account, a plan and a logo that is not yours.</p>
<p>A browser can show a device's own notifications, the same ones its apps show, and has been able to for years: web push, with a service worker and a pair of VAPID keys. Wiring it to a site is still the work: the keys made and kept, a subscription per browser that must be stored and renewed, a service worker served from the site's own address, a payload that opens the right record on a tap, and the subscription that dies when the browser is reset. <code>kitloom/<wbr>notifications</code> has it as a channel beside Telegram, Slack, Discord, Teams, Pushover and email, and the owner turns it on with one tap.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user manages notifications lists the channels with their news (<code>notifications_<wbr>list</code>), changes their name, their topics and whether they are on (<code>notifications_<wbr>update</code>), and sends a test (<code>notifications_<wbr>test</code>):</p>
<ul>
<li><em>&quot;Send the shop's orders to my phone, and the failed backups to the laptop too.&quot;</em></li>
<li><em>&quot;Which channels stopped taking messages this week?&quot;</em></li>
<li><em>&quot;Send a test to my phone.&quot;</em></li>
</ul>
<p>A browser channel is turned on only in the browser itself, never by an agent: the permission is the device's to give.</p>
<h2 id="set-up-in-the-admin" tabindex="-1">Set up in the admin <a class="header-anchor" href="#set-up-in-the-admin" aria-label="Permalink to &quot;Set up in the admin&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Notifications → Channels → New channel</strong>: a name after the device — <em>My phone</em> — and under <strong>Send to</strong>, <em>Browser</em>. The <em>Browser</em> section has nothing to type: it says to save the channel first, then turn it on from the device that should be told. The news worth acting on is ticked already; the rest is a tick away.</p>
<ol>
<li>Save. The channel is off for now: no browser takes it yet. The section now has the button, <strong>Turn on in this browser</strong>.</li>
<li>On the phone, signed in to the admin, open the channel and tap the button. A page of the site says what will happen; its button asks the browser's permission. Allow it, and the page comes back to the channel, on and naming the browser: <em>Chrome on Android, since …</em>.</li>
<li><strong>Send test</strong>: the notification shows on the phone, even with the site closed. A tap on it opens the record in the admin.</li>
</ol>
<p>From then on each piece of news the channel ticked lands on the phone as it happens: a new order with the customer and the items, a booking request, a form message, a comment waiting, a failed health check. It reads like any other notification — the heading, the lines about the record, the site's name — in the site's language.</p>
<p>One channel is one browser on one device. The laptop gets a channel of its own, and a second phone another; the shop's orders can go to one and a failed backup to both. Two channels on the same browser both reach it.</p>
<p><strong>What works</strong>: Chrome, Edge, Firefox, Opera and Samsung Internet on Android and on computers, Safari on a Mac. On an iPhone or iPad, iOS 16.4 and later, only from the Home Screen: in Safari, <em>Share → Add to Home Screen</em>, open the site from the new icon, sign in there and turn the channel on from that window. A browser in private mode does not keep the permission.</p>
<h2 id="when-the-browser-lets-go" tabindex="-1">When the browser lets go <a class="header-anchor" href="#when-the-browser-lets-go" aria-label="Permalink to &quot;When the browser lets go&quot;">&ZeroWidthSpace;</a></h2>
<p>A browser may drop the notifications: it was reset, its data was cleared, the permission was taken back in its settings. The next message then fails for good. The channel is turned off at once, the site's admin gets an email that says which browser, the list says it stopped taking them, and Site Health warns while a browser channel has no browser. Opening the channel in that browser and tapping <strong>Turn on in this browser</strong> again is the whole fix.</p>
<p>Nothing else changes with the channel. Repeats are held back as on every channel — a product that stays low in stock reaches the phone once an hour, not at every order — and a new order is never held back. Messages go from the queue, so a push service that is slow does not slow the checkout. The site keeps no copy of them.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>The site signs its notifications with keys of its own, VAPID, made the first time a browser is turned on and kept in the options, the private one encrypted with the application key. A new application key loses it, and the browsers then need turning on again. The channel is <code>Web<wbr>Push<wbr>Channel</code> on <a href="https://github.com/web-push-libs/web-push-php" target="_blank" rel="noreferrer">minishlink/web-push</a>, with a payload of a title, a body, the record's address and a tag; the page that asks the permission is <code>/<wbr>notifications/<wbr>push/<wbr>{id}</code> and the service worker <code>/<wbr>notifications/<wbr>push-<wbr>worker.<wbr>js</code>, both the site's own. A test or a demo keeps off the network with a Guzzle handler in the module's config, or <code>Fakes<wbr>Channels::<wbr>fake<wbr>Push()</code>.</p>
<p>Your own module's news reaches the phone the same way as every other channel: a <code>Notification<wbr>Topic</code> tagged in the container, answering a <code>Notice</code> with a title, a few lines and the record. Nothing in it names a browser, a chat or a provider; the owner chooses where each topic goes. It comes with both admins, Filament and Nova.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>A short lesson from the admin, narrated:</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/notifications/filament/browser-channel.jpg" src="https://media.kitloom.dev/lessons/notifications/filament/browser-channel.mp4"></video>
  <figcaption>Notifications in the browser, on your phone: a channel per device, turned on with one tap, a test that shows with the site closed</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail — the news each module brings, the other channels, the settings, the agent's tools — is in the <a href="https://kitloom.dev/docs/modules/guides/notifications.html">Notifications guide</a>; how the Telegram and Slack channels work is in <a href="https://kitloom.dev/blog/telegram-notifications-in-laravel.html">Telegram and Slack notifications in Laravel</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Change any text of a Laravel site from the admin, in any language</title>
      <link>https://kitloom.dev/blog/change-any-text-of-a-laravel-site-from-the-admin.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/change-any-text-of-a-laravel-site-from-the-admin.html</guid>
      <pubDate>Sun, 01 Nov 2026 12:00:00 GMT</pubDate>
      <description>A Loco Translate for Laravel: every text the code says through __(), per module, theme and language, edited in the admin. Change a button, or translate the site into a language it does not ship, with no file and no deploy.</description>
      <content:encoded><![CDATA[<p>The shop's button says <em>Add to cart</em>, and the owner wants <em>Add to basket</em>. On a Laravel site that is a ticket: find which package says it, add a line to <code>lang/<wbr>en.<wbr>json</code>, commit, deploy. Next month the owner wants a German site, and a developer is copying English sentences from a dozen packages into a file for a translator, then again after every update, when new sentences have appeared and nobody can say which.</p>
<p>WordPress sites answer this with Loco Translate. A Laravel application has no such screen of its own, since Laravel keeps its sentences in code and in files that belong to whoever wrote them. <code>kitloom/<wbr>phrases</code> is that screen: every text your site and its admin say, listed by the package that says it, with your own line laid over the package's without touching its file.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user may manage phrases does it from your chat:</p>
<ul>
<li><em>&quot;Which modules have no German yet?&quot;</em> (<code>phrases_<wbr>packages</code>, the texts translated of the total per language)</li>
<li><em>&quot;Show me the shop's texts about delivery.&quot;</em> (<code>phrases_<wbr>list</code>)</li>
<li><em>&quot;Say Add to basket instead of Add to cart, everywhere.&quot;</em> (<code>phrases_<wbr>set</code>, as a line on the site or as a draft for you to read)</li>
</ul>
<p>An agent's line goes through the same checks as yours: one that loses what its text fills in is refused, with a message it reads.</p>
<h2 id="what-a-phrase-is" tabindex="-1">What a phrase is <a class="header-anchor" href="#what-a-phrase-is" aria-label="Permalink to &quot;What a phrase is&quot;">&ZeroWidthSpace;</a></h2>
<p>A phrase is a text a developer wrote in the code: <code>Read more</code>, <code>Add to cart</code>, <code>Your order is on its way</code>. What you typed yourself is something else: the site's title, a page, a menu item, a product's name. Those are content, and <a href="https://kitloom.dev/docs/modules/guides/languages.html">kitloom/languages</a> translates them with the rest of the site. Phrases never touches them.</p>
<h2 id="one-word-on-every-page" tabindex="-1">One word, on every page <a class="header-anchor" href="#one-word-on-every-page" aria-label="Permalink to &quot;One word, on every page&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Phrases → Phrases</strong> lists where the texts come from: each module, each theme, the core packages and <em>This site</em>, your application's own code. Each row counts its texts and, for every language, how many have a line. Open a package in a language and each text has three columns:</p>
<ul>
<li><strong>Source</strong>, the English as the code says it. Under it, <em>Also in 2 other packages</em> when others say the very same words: Laravel keeps one dictionary, so your line is read wherever they appear.</li>
<li><strong>Shipped</strong>, what the package itself translates it as. Read-only, since the file belongs to the package.</li>
<li><strong>Yours</strong>, your line. Type it, leave the field, and it is on the site: the page cache is cleared with it. Empty it and the shipped words stand again.</li>
</ul>
<p>A line must keep what its text fills in: <code>:<wbr>name</code>, <code>:<wbr>count</code>, <code>%s</code>, and the <code>|</code> between plural forms. <code>Add :<wbr>amount more for free delivery.</code> without <code>:<wbr>amount</code> would draw a sentence with no figure in it, so such a line is refused, with a note saying what is missing.</p>
<h2 id="a-language-kitloom-does-not-ship" tabindex="-1">A language kitloom does not ship <a class="header-anchor" href="#a-language-kitloom-does-not-ship" aria-label="Permalink to &quot;A language kitloom does not ship&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Add language</strong> takes a locale: <code>de</code>, <code>uk</code>, <code>pt_<wbr>BR</code>. It gets a column, and each package starts at zero. Type the lines you care about, or, with <a href="https://kitloom.dev/docs/ai-writer.html">AI Writer</a> set up, press <strong>Translate empty with AI</strong>: the texts with no line go to your own model in the background and come back as <strong>drafts</strong>. A draft is kept and marked, and it is shown nowhere until a person has read it and pressed <strong>Publish drafts</strong>. A line the model returned without its placeholders is dropped and counted, so a broken sentence never reaches a page.</p>
<p>To make the site speak it, set <strong>Site Language</strong> in Settings → General to that locale; what has no line yet stays in English. With kitloom/languages, a page speaks that module's languages instead: add German there, and its lines come from here. A line written for <code>fr</code> is read on a Canadian French page too, unless <code>fr_<wbr>CA</code> has one of its own.</p>
<h2 id="your-words-in-git" tabindex="-1">Your words in git <a class="header-anchor" href="#your-words-in-git" aria-label="Permalink to &quot;Your words in git&quot;">&ZeroWidthSpace;</a></h2>
<p>A line in the database is right for an owner; a developer may want it in a file. Three ways out:</p>
<ul>
<li><strong>Import JSON</strong> brings in a dictionary, <code>&quot;English text&quot;:<wbr> &quot;line&quot;</code>: a translator's work, or the <code>lang/<wbr>de.<wbr>json</code> of another site.</li>
<li><strong>Export JSON</strong> gives a package's lines as its own <code>lang/<wbr>de.<wbr>json</code>, merged with what it ships if you ask: the file a developer commits, so the next site has your translation out of the box.</li>
<li><strong>Move to code</strong> writes every line of a language into the application's <code>lang/<wbr>de.<wbr>json</code>, which Laravel reads over the packages'. Tick <em>remove the rows</em> and the file alone speaks from then on: for a site that has settled and keeps its words in git.</li>
</ul>
<p>The same from the console, for a deploy or a check in CI:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> phrases:scan</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --check</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">                              # the texts without a line; fails when any</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> phrases:export</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> de</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --package=kitloom/shop</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --merge</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">  # the shop's lang/de.json</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> phrases:import</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> translations.json</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --locale=de</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">      # a dictionary into German</span></span></code></pre>
</div><h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>The lines live in a <code>phrases</code> table of the module's own: group, key, locale, text, status, source and who wrote it. They reach Laravel's translator through <a href="https://github.com/spatie/laravel-translation-loader" target="_blank" rel="noreferrer">spatie/laravel-translation-loader</a>, whose manager reads a group from the language files as Laravel does and lays the loaders' lines over them. The module names itself as the one loader rather than using spatie's <code>Language<wbr>Line</code>, whose one JSON column of locales has no room for a status or an author per language, and whose fallback would show an English override on a French page.</p>
<p>Which texts a package says is read from its code by the same scanner the packages' translation tests use: <code>__<wbr>()</code>, <code>trans_<wbr>choice()</code>, <code>@lang()</code>, a post type's labels, <code>t()</code> in a theme's scripts. The lines of a group are read once into the cache and forgotten when one is written, and a long-lived Octane or queue worker compares a version at the start of each request, so one worker's edit reaches the others. Vue and React themes get the same lines. It comes with both admins, Filament and Nova, behind its own permission, <code>manage_<wbr>phrases</code>.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>Two short lessons from the admin, narrated:</p>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/phrases/filament/phrases.jpg" src="https://media.kitloom.dev/lessons/phrases/filament/phrases.mp4"></video>
  <figcaption>Change a word: a button of the theme, on every page at once, a line refused for losing its figure, and Reset</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/phrases/filament/languages.jpg" src="https://media.kitloom.dev/lessons/phrases/filament/languages.mp4"></video>
  <figcaption>A language of your own: German added, a line by hand, a module translated by the site's AI model as drafts, and the files that take the lines out</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>The module comes with kitloom, for either admin, and is off until you ask for it. On a Filament site:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/phrases</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/phrases-filament</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> migrate</span></span></code></pre>
</div><p>On a Nova site, the second package is <code>kitloom/<wbr>phrases-<wbr>nova</code>. Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail, from the filters to the console commands and the agent's tools, is in the <a href="https://kitloom.dev/docs/modules/guides/phrases.html">Phrases guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Send contact form messages to HubSpot or Pipedrive from WordPress, through a webhook</title>
      <link>https://kitloom.dev/blog/contact-form-to-hubspot-pipedrive-webhook.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/contact-form-to-hubspot-pipedrive-webhook.html</guid>
      <pubDate>Sun, 01 Nov 2026 12:00:00 GMT</pubDate>
      <description>A contact form message becomes a HubSpot contact or a Pipedrive lead the moment it arrives: one outgoing webhook from the admin, Zapier, Make or n8n mapping the fields, every delivery signed, retried and logged.</description>
      <content:encoded><![CDATA[<p>A visitor fills in the contact form. The message lands in the site's inbox and in an email, and the sales team, who live in HubSpot or Pipedrive all day, hear about it when someone forwards it on Thursday. On WordPress the fix was a plugin per form and per CRM, each with its own settings page and its own idea of a field name.</p>
<p>A site that moved to Laravel keeps those forms — Contact Form 7's forms and their Flamingo messages come along as they were, see <a href="https://kitloom.dev/blog/contact-form-7-in-laravel.html">Contact Form 7 in Laravel</a> — and now it tells the CRM itself. <code>kitloom/<wbr>webhooks</code> has a topic for form messages: one webhook to an address Zapier, Make or n8n gives you, the fields mapped once, and every message from then on is a contact in the CRM within seconds.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user manages webhooks sets one up and watches it:</p>
<ul>
<li><em>&quot;Send every contact form message to this Zapier address.&quot;</em> (<code>webhooks_<wbr>create</code> — it answers the secret once, for the receiver)</li>
<li><em>&quot;Did Marie's message from this morning reach Zapier?&quot;</em> (<code>webhooks_<wbr>deliveries</code>)</li>
<li><em>&quot;Add bookings to the CRM webhook too, and send a test.&quot;</em> (<code>webhooks_<wbr>update</code> with <code>ping:<wbr> true</code>)</li>
</ul>
<p>Nothing is deleted: a webhook the team no longer needs is disabled, and its log stays. <code>describe_<wbr>site</code> tells the agent every topic the site has and how a delivery is signed before it starts.</p>
<h2 id="set-up-in-the-admin" tabindex="-1">Set up in the admin <a class="header-anchor" href="#set-up-in-the-admin" aria-label="Permalink to &quot;Set up in the admin&quot;">&ZeroWidthSpace;</a></h2>
<p>In Zapier first: a Zap whose trigger is <em>Webhooks by Zapier, Catch Hook</em> gives you an address to send to; the action is <em>Create Contact</em> in HubSpot or <em>Create Lead</em> in Pipedrive, with the fields mapped from the first message that comes in. Make's <em>Custom webhook</em> and n8n's Webhook node do the same.</p>
<p>Then <strong>Webhooks → Webhooks → New</strong>:</p>
<ol>
<li><strong>Name</strong> says where it goes. <strong>Delivery URL</strong> is the address Zapier gave you; the site POSTs there, to a public address only. A webhook to the server's own network is refused, so nobody can use the log to read what the server sees inside it.</li>
<li><strong>Secret</strong> signs every delivery. Zapier does not check it; a receiver of your own should, and a secret the receiver gives you can be pasted instead of the one generated.</li>
<li><strong>Topics</strong>: tick <em>Forms: Form submitted</em> alone. Orders and bookings can have webhooks of their own, to the warehouse's tools or the salon's calendar.</li>
<li>Save. The webhook is active from now on; <strong>Send test</strong> sends a <code>ping</code> at once and shows what the receiver answered.</li>
</ol>
<p>When a visitor writes through the form, the message is kept in the inbox as before, the emails go out, and the webhook fires once the message is safely stored. <strong>Deliveries</strong> lists each call: the topic, the attempts, the receiver's answer. A 200 means Zapier took it; a failed delivery is tried again after a growing wait, three times, and a receiver that keeps failing pauses the webhook rather than filling the log, with <em>Resume</em> a click away.</p>
<h2 id="what-the-crm-gets" tabindex="-1">What the CRM gets <a class="header-anchor" href="#what-the-crm-gets" aria-label="Permalink to &quot;What the CRM gets&quot;">&ZeroWidthSpace;</a></h2>
<p>A <code>POST</code> with a JSON body, the topic in <code>X-<wbr>Kitloom-<wbr>Topic</code> and an HMAC-SHA256 signature of the body in <code>X-<wbr>Kitloom-<wbr>Signature</code>:</p>
<div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">  "id"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"6f1c0c6e-2a3b-4a0d-9d2e-5b1f3b7a0c11"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">  "topic"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"form.submitted"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">  "created_at"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"2026-11-01T14:03:00Z"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">  "site"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"https://example.com"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">  "data"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    "form"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">"id"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">12</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">"title"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"Contact us"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">"slug"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"contact-us"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">},</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    "fields"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">"your-name"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"Marie Dubois"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">"your-email"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"marie@example.com"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">"your-message"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"Do you ship to Belgium?"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">},</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    "page"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">"url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"https://example.com/contact/"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">"post_id"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">7</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">},</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    "message_id"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">1043</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    "submitted_at"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"2026-11-01T14:03:00Z"</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">  }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>The fields are by name, as the visitor filled them, so <code>your-<wbr>email</code> maps to the contact's email and <code>your-<wbr>name</code> to the name once, for every message after. The page says which form on which page it came from; the message id finds it in <strong>Contact → Messages</strong>. Nothing of the visitor's address, browser or account goes along, and nothing of the spam check: a message the form refused, or one caught as spam, is never sent.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>The form topic is one class, a <code>Webhook<wbr>Topic</code>, that listens to the forms module's <code>Submission<wbr>Received</code> event and shapes the body; the webhooks module never requires the forms module, it only asks whether the event exists. A topic of your own — a review published, an application received — is the same class, tagged in your provider, and lands on the webhook form and in the agent's description of the site.</p>
<p>A receiver of your own checks the signature over the body exactly as received:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$expected </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> hash_hmac</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'sha256'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, $request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getContent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(), $secret);</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">abort_unless</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">hash_equals</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($expected, $request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">header</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'X-Kitloom-Signature'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">''</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">403</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span></code></pre>
</div><p>Deliveries go out from the queue through <a href="https://github.com/spatie/laravel-webhook-server" target="_blank" rel="noreferrer">spatie/laravel-webhook-server</a>, so a slow CRM never slows the form, and the log keeps every body and answer for the retention days you set. It comes with both admins, Filament and Nova.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>A short lesson from the admin, narrated:</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/webhooks/filament/form-to-crm.jpg" src="https://media.kitloom.dev/lessons/webhooks/filament/form-to-crm.mp4"></video>
  <figcaption>Form messages to a CRM: a webhook to Zapier, a message sent, its delivery and body</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every topic the site sends, the headers and the bodies are in the <a href="https://kitloom.dev/docs/modules/guides/webhooks.html">Webhooks guide</a>; the forms themselves are in the <a href="https://kitloom.dev/docs/modules/guides/forms.html">Forms guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>A Laravel CMS starter kit: laravel new, with Filament or Nova</title>
      <link>https://kitloom.dev/blog/laravel-cms-starter-kit.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/laravel-cms-starter-kit.html</guid>
      <pubDate>Sun, 01 Nov 2026 12:00:00 GMT</pubDate>
      <description>kitloom now starts from the Laravel installer: laravel new --using=kitloom/filament-skeleton creates a site with a Filament or Nova admin, themes, a demo and an MCP server for AI agents.</description>
      <content:encoded><![CDATA[<p>A Laravel starter kit gives you a sign-in, a dashboard and a front end to build on. That is the right start for an application. For a website it leaves out what the client asks about on the first day: where do I write a post, change the menu, upload a picture?</p>
<p>kitloom now starts the way those kits do, from the Laravel installer:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">laravel</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> new</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> my-site</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --using=kitloom/filament-skeleton</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --phpunit</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> -v</span></span></code></pre>
</div><p>What comes out is a Laravel 13 site an AI agent can run with the rights you give it: an <a href="https://kitloom.dev/docs/ai.html">MCP server</a> at <code>/<wbr>mcp</code>, posts, pages, media and menus in a Filament admin your editors already know, and a theme of your choice, filled with a demo if you want one.</p>
<h2 id="before-the-command" tabindex="-1">Before the command <a class="header-anchor" href="#before-the-command" aria-label="Permalink to &quot;Before the command&quot;">&ZeroWidthSpace;</a></h2>
<p>The kit is public, the packages it installs are not: kitloom is <a href="https://kitloom.dev/pricing.html">paid</a>. Your purchase email has a name and a token. Save them once per machine, and tell Composer where the skeleton comes from:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> config</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --global</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> http-basic.packages.kitloom.dev</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> &#x3C;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">your-nam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">e</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> &#x3C;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">your-toke</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> config</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --global</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> repositories.kitloom</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> https://packages.kitloom.dev</span></span></code></pre>
</div><p>You need PHP 8.4 or newer. For Laravel Nova the kit is <code>kitloom/<wbr>nova-<wbr>skeleton</code>; Nova's own license comes from Laravel.</p>
<p>Two flags matter. <code>-<wbr>v</code> lets the installer ask its questions: without it Composer runs behind a progress bar, and the site keeps the usual modules with no theme. <code>--<wbr>phpunit</code> keeps the site's tests on PHPUnit: without it the installer moves them to Pest and prints warnings about a workflow file the kit does not have.</p>
<h2 id="what-it-asks" tabindex="-1">What it asks <a class="header-anchor" href="#what-it-asks" aria-label="Permalink to &quot;What it asks&quot;">&ZeroWidthSpace;</a></h2>
<ol>
<li><strong>Themes</strong>, none ticked. A theme keeps the modules it needs and says so.</li>
<li><strong>The active theme</strong>, or none: then the site answers with JSON, for a front end of your own.</li>
<li><strong>Modules</strong>, group by group, with the usual ones ticked: SEO, forms, redirects, two-factor sign-in, the REST API, AI agents, backups. The shop, bookings, courses and the rest are there to tick.</li>
<li><strong>The demo</strong>: posts, pages, menus and widgets, so the theme looks lived in.</li>
</ol>
<p>What you leave out goes with <code>composer remove</code>, so <code>composer.<wbr>json</code> names exactly what the site runs. A module left out comes back later with <code>composer require</code>.</p>
<p>We ran this from the kit's public repositories with an empty Composer cache, the Garland theme and its demo: under three minutes for each admin, on a development machine. The front page, <code>/<wbr>wp-<wbr>json/</code> and the admin's login answered, and the site's tests passed. A Vue or React theme adds its build to that.</p>
<h2 id="what-you-have-then" tabindex="-1">What you have then <a class="header-anchor" href="#what-you-have-then" aria-label="Permalink to &quot;What you have then&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>An agent that can run it.</strong> In the admin, <strong>AI agents → Connect an agent</strong> gives you the address. <a href="https://kitloom.dev/blog/connect-claude-or-chatgpt-to-your-laravel-site.html">Claude, ChatGPT or Cursor sign in</a> without a key to copy, and work with the rights of the user who approved them. Ask for &quot;a page about our opening hours, in the main menu&quot; and the tools it reaches for, such as <code>create_<wbr>content</code>, go through the same code as the admin.</p>
<p><strong>An admin for the editors.</strong> Filament 5 at <code>/<wbr>admin</code> or Nova 5 at <code>/<wbr>nova</code>: posts, pages, media, menus, users and a Modules screen that switches modules on and off.</p>
<p><strong>A front end you choose.</strong> A <a href="https://kitloom.dev/docs/themes/catalog.html">theme</a> in Blade, Vue or React, switched with <code>php artisan site:<wbr>theme</code> or in <strong>Appearance → Themes</strong>. No build is needed for the switch, as <code>npm run build</code> builds every theme you kept.</p>
<p><strong>A project that explains itself to whoever codes in it.</strong> The kit brings <code>AGENTS.<wbr>md</code>, <code>CLAUDE.<wbr>md</code> and a deploy skill. <code>php artisan kitloom:<wbr>make-<wbr>module Reviews</code> and <code>php artisan kitloom:<wbr>make-<wbr>theme Recipes</code> write code of your own, and <code>php artisan kitloom:<wbr>deploy-<wbr>kit server --<wbr>domain=example.<wbr>com</code> writes <a href="https://kitloom.dev/docs/deployment.html">what the server needs</a>. The tests in <code>tests/</code> are yours; kitloom's stay with its packages.</p>
<p><strong>And your WordPress site, if you have one.</strong> It <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">comes along</a> with its database, addresses and users.</p>
<h2 id="how-it-differs-from-laravel-s-own-kits" tabindex="-1">How it differs from Laravel's own kits <a class="header-anchor" href="#how-it-differs-from-laravel-s-own-kits" aria-label="Permalink to &quot;How it differs from Laravel's own kits&quot;">&ZeroWidthSpace;</a></h2>
<p>Laravel's kits start an application: Fortify's sign-in on the <code>users</code> table, and a dashboard to build from. They are the better start when the product is the application.</p>
<p>kitloom's kit starts a site. Its users live in WordPress's user table, with the site's own sign-in, two-factor, social login and account sections, so it is not a layer over those kits. It runs on WordPress's data model and no WordPress code at all.</p>
<h2 id="without-the-installer" tabindex="-1">Without the installer <a class="header-anchor" href="#without-the-installer" aria-label="Permalink to &quot;Without the installer&quot;">&ZeroWidthSpace;</a></h2>
<p>Composer alone creates the same site, and needs only the first of the two lines above:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> create-project</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/filament-skeleton</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> my-site</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --repository=https://packages.kitloom.dev</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --add-repository</span></span></code></pre>
</div><h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Before you buy, open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. You can read what a site starts from in <a href="https://github.com/kitloom/filament-starter" target="_blank" rel="noreferrer">kitloom/filament-starter</a> and <a href="https://github.com/kitloom/nova-starter" target="_blank" rel="noreferrer">kitloom/nova-starter</a>. Every question and flag is in the <a href="https://kitloom.dev/docs/installation.html#starting-from-a-skeleton">installation guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Laravel ecommerce packages compared: Bagisto, Lunar, Aimeos, Vanilo, Shopper, Cashier and kitloom</title>
      <link>https://kitloom.dev/blog/laravel-ecommerce-packages-compared.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/laravel-ecommerce-packages-compared.html</guid>
      <pubDate>Sun, 01 Nov 2026 12:00:00 GMT</pubDate>
      <description>Which Laravel ecommerce package fits your shop: a full store, a headless core, billing only, or a CMS whose shop is a module, with a storefront and an AI agent that runs it.</description>
      <content:encoded><![CDATA[<p>A shop on Laravel is a solved problem several times over, and the solutions do not look alike. Some are whole applications you install and then work inside; some are a core of models you build a storefront on; one is only the billing. kitloom is none of those three: a CMS for Laravel whose shop is one of its modules, with the storefront, the admin and the agent that runs it. Here is what each one is, side by side, and when each is the better choice.</p>
<h2 id="what-each-one-is" tabindex="-1">What each one is <a class="header-anchor" href="#what-each-one-is" aria-label="Permalink to &quot;What each one is&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Bagisto</strong> is a complete store from Webkul, under MIT: admin, storefront, multi-vendor marketplace, B2B, point of sale, a headless storefront on Next.js and a Flutter app, with a marketplace of over 200 extensions. It is an application, not a package: you install Bagisto and build inside its module structure.</p>
<p><strong>Lunar</strong> is a headless core under MIT: Eloquent models and services for products, orders and customers, with an admin built on Filament. There is no storefront; you build it, and a Vue starter kit is announced.</p>
<p><strong>Aimeos</strong> is a mature PHP ecommerce framework, LGPLv3 and MIT, with a Laravel package: templates, a JSON:API REST API and GraphQL, multi-tenancy in the core, B2B and marketplace extensions sold separately. It is made for large catalogs and has conventions of its own beside Laravel's.</p>
<p><strong>Vanilo</strong> is a modular framework under MIT, version 6 since September 2026 on Laravel 12 and 13: products, cart, promotions, checkout and orders as modules you pick, behind interfaces you can swap your own models into. No storefront, a limited admin.</p>
<p><strong>Shopper</strong> is an ecommerce core and admin under MIT on Laravel 11 and up, built on Filament; version 3 adds a Store API and a JavaScript SDK for storefronts you write yourself.</p>
<p><strong>Laravel Cashier</strong> is Laravel's own billing package for Stripe and Paddle: subscriptions, trials, one-off charges, invoices and Stripe or Paddle checkout. It is not a store. Its docs say so: the cart and order models in its examples are yours to write, and the products live in the Stripe dashboard.</p>
<p><strong>kitloom</strong> is a Laravel CMS, and its shop is a module. A new site gets the WordPress data model from a migration, with no WordPress installed; the shop keeps its products, carts and orders in WooCommerce's tables and formats, so a live WooCommerce shop opens here as it is. What comes with it:</p>
<ul>
<li>an AI agent runs the shop over MCP, with the rights you give it: <code>product_<wbr>save</code>, <code>orders_<wbr>list</code>, <code>order_<wbr>set_<wbr>status</code>, <code>coupon_<wbr>save</code>, <code>sales_<wbr>report</code>;</li>
<li>an admin in Filament 5 or Laravel Nova 5, the same screens in each;</li>
<li>a storefront: shop themes in Vue and React, a Nuxt and a Next.js storefront on the same pages as JSON, or a Blade theme with the shop's shortcodes;</li>
<li>payments through kitloom/payments: Stripe, PayPal, Mollie, Square, Paddle, Monobank, LiqPay, WayForPay, Hutko, and bank transfer and cash on delivery;</li>
<li>the rest of a site around the shop, as modules of the same product: pages and posts, SEO, redirects, forms, languages, PDF invoices, ads with a product feed, texts and Telegram notifications for new orders, bookings and courses.</li>
</ul>
<h2 id="side-by-side" tabindex="-1">Side by side <a class="header-anchor" href="#side-by-side" aria-label="Permalink to &quot;Side by side&quot;">&ZeroWidthSpace;</a></h2>
<table tabindex="0">
<thead>
<tr>
<th></th>
<th>kitloom</th>
<th>Bagisto</th>
<th>Lunar</th>
<th>Aimeos</th>
<th>Vanilo</th>
<th>Shopper</th>
<th>Cashier</th>
</tr>
</thead>
<tbody>
<tr>
<td>What it is</td>
<td>A CMS whose shop is a module</td>
<td>A whole store application</td>
<td>A headless core and admin</td>
<td>A framework with a Laravel package</td>
<td>Modules you pick</td>
<td>A core and admin</td>
<td>Billing only</td>
</tr>
<tr>
<td>Storefront</td>
<td>Included: themes in Vue, React or Blade; Nuxt and Next.js storefronts</td>
<td>Included, and headless on Next.js</td>
<td>You build it</td>
<td>Templates included, and headless</td>
<td>You build it</td>
<td>You build it (Store API and SDK in v3)</td>
<td>None</td>
</tr>
<tr>
<td>Admin</td>
<td>Filament 5 or Nova 5</td>
<td>Its own</td>
<td>Filament</td>
<td>Its own, Vue.js</td>
<td>Limited</td>
<td>Filament</td>
<td>None</td>
</tr>
<tr>
<td>Data model</td>
<td>WooCommerce's tables and formats</td>
<td>Its own tables</td>
<td>Its own Eloquent models</td>
<td>Its own</td>
<td>Its own, behind interfaces</td>
<td>Its own</td>
<td>Stripe's or Paddle's</td>
</tr>
<tr>
<td>Coming from WooCommerce</td>
<td>Nothing to import: the shop opens on its database, with its orders, customers and settings</td>
<td>An import</td>
<td>An import you write</td>
<td>An import</td>
<td>An import you write</td>
<td>An import you write</td>
<td>n/a</td>
</tr>
<tr>
<td>Payments</td>
<td>Stripe, PayPal, Mollie, Square, Paddle, Monobank, LiqPay, WayForPay, Hutko, offline methods</td>
<td>Connectors from the marketplace</td>
<td>Drivers you add</td>
<td>Extensions</td>
<td>Modules</td>
<td>Drivers you add</td>
<td>Stripe, Paddle</td>
</tr>
<tr>
<td>Subscriptions</td>
<td>Not yet</td>
<td>Extension</td>
<td>No</td>
<td>Extension</td>
<td>No</td>
<td>No</td>
<td>Yes, its purpose</td>
</tr>
<tr>
<td>Multi-vendor, B2B</td>
<td>No</td>
<td>Yes, core and add-ons</td>
<td>No</td>
<td>Extensions</td>
<td>No</td>
<td>Yes</td>
<td>No</td>
</tr>
<tr>
<td>Beyond the shop</td>
<td>The site itself: pages, SEO, forms, languages, bookings, courses, invoices, ads</td>
<td>Blog pages in the store</td>
<td>Your application</td>
<td>Your application</td>
<td>Your application</td>
<td>Your application</td>
<td>Your application</td>
</tr>
<tr>
<td>AI agents</td>
<td>Built in: an MCP server, the shop's tools with the key's user's rights, and tools for shoppers' own assistants</td>
<td>LLM integrations</td>
<td>No</td>
<td>No</td>
<td>No</td>
<td>No</td>
<td>No</td>
</tr>
<tr>
<td>License, price</td>
<td>Proprietary: $299 for one site, a year of every update and new module, 14-day refund</td>
<td>MIT; paid extensions</td>
<td>MIT</td>
<td>LGPLv3 and MIT; paid extensions</td>
<td>MIT</td>
<td>MIT</td>
<td>MIT</td>
</tr>
</tbody>
</table>
<h2 id="when-another-package-is-the-better-choice" tabindex="-1">When another package is the better choice <a class="header-anchor" href="#when-another-package-is-the-better-choice" aria-label="Permalink to &quot;When another package is the better choice&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>You are building a marketplace or a B2B store.</strong> Bagisto has multi-vendor, B2B and POS in the box, Aimeos has them as extensions. kitloom's shop sells for one seller.</li>
<li><strong>Your products do not fit a product with a price.</strong> Lunar and Vanilo give you Eloquent models to shape, and you own the schema. kitloom's shop is WooCommerce's data model: products, variations, attributes, coupons, shipping zones, tax rates, as a shop of goods needs them.</li>
<li><strong>The storefront is the product, and the shop is small.</strong> Lunar or Shopper, with the storefront you want to write anyway, is less to carry than a CMS.</li>
<li><strong>You sell subscriptions to a SaaS.</strong> Cashier is the right tool and nothing else is needed: no cart, no shipping, no catalog outside Stripe. kitloom's shop takes one-off orders today.</li>
<li><strong>Very large catalogs.</strong> Aimeos is built and measured for them.</li>
<li><strong>No budget for software.</strong> Every package above is MIT or LGPL; kitloom is paid, with everything visible in a sandbox before you buy and a refund after.</li>
</ul>
<h2 id="when-kitloom-is" tabindex="-1">When kitloom is <a class="header-anchor" href="#when-kitloom-is" aria-label="Permalink to &quot;When kitloom is&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>An AI agent runs the shop, under your control.</strong> Connect Claude, Cursor or your own agent to the site's <code>/<wbr>mcp</code> and ask: &quot;mark every order paid by bank transfer this week as completed and tell the customers&quot;, &quot;put the five products that sold least in October on sale at 20 %&quot;, &quot;make a coupon for the newsletter, 10 % off, until the end of the month&quot;. It does the work through the same code as the admin, as the user it signed in as: an author's key cannot see the orders, nothing is deleted for good, every change is in the activity log. Shoppers' own assistants get the catalogue over MCP too, read-only, and hand the shopper a cart link. See <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site with an AI agent</a> and <a href="https://kitloom.dev/blog/shoppers-ai-assistants.html">Shoppers' AI assistants</a>.</li>
<li><strong>The shop is part of a site.</strong> Most shops have pages, a blog, forms, SEO, a second language, and later bookings or courses. With a store application those live elsewhere or in a corner of the store; with a core they are your application. In kitloom they are modules of the same product, tested together, with the same admin and the same agent.</li>
<li><strong>You are on WooCommerce now.</strong> The shop opens on its database: products with their variations and attributes, HPOS orders, customers who sign in with their passwords, coupons, shipping zones, tax rates and the settings, at the same URLs. Refund an order from the new admin; the row is written as WooCommerce writes it. See <a href="https://kitloom.dev/blog/woocommerce-to-laravel.html">Migrate WooCommerce to Laravel</a>.</li>
<li><strong>The storefront should exist on day one.</strong> Choose a shop theme and the site sells today; swap it for Vue, React, Nuxt or Next.js later, on the same JSON.</li>
<li><strong>Your team works in Filament or Nova.</strong> The shop's screens are ordinary Filament resources or Nova resources; nothing new to learn, and both admins are maintained for every module.</li>
<li><strong>Payments in several countries.</strong> Nine online gateways and the offline methods are in one settings page, and the invoices, the texts and the notifications read the same order.</li>
</ul>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Bagisto, Lunar, Aimeos, Vanilo and Shopper install with Composer from their sites; Cashier is in Laravel's docs.</p>
<p>For kitloom, open a sandbox in one click, no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament demo</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova demo</a>, with the shop filled and an agent to connect from the dashboard. Then point it at your own WooCommerce database, read-only first: <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a>. The shop's guide is at <a href="https://kitloom.dev/docs/modules/guides/shop.html">Shop</a>, the payments' at <a href="https://kitloom.dev/docs/modules/guides/payments.html">Payments</a>. Prices and the refund are on <a href="https://kitloom.dev/pricing.html">Pricing</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Mollie and Square payments in a Laravel shop, without code</title>
      <link>https://kitloom.dev/blog/mollie-and-square-in-a-laravel-shop.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/mollie-and-square-in-a-laravel-shop.html</guid>
      <pubDate>Sun, 01 Nov 2026 12:00:00 GMT</pubDate>
      <description>Take Mollie (iDEAL, Bancontact, cards, Klarna) and Square (cards and wallets) in a Laravel shop: one API key or a token and a location pasted in the admin, test mode first, the order paid on return, refunds back through the gateway.</description>
      <content:encoded><![CDATA[<p>A shop that sells in the Netherlands or Belgium loses the sale the moment the checkout shows only a card form: the customer wanted iDEAL or Bancontact, the way they pay for everything else. A café in Toronto or a studio in Manchester already runs its counter on Square, and wants the website's orders in the same place, the same settlements, the same dashboard. A card form alone answers neither.</p>
<p>On a Laravel site each gateway is a project of its own: a redirect to the provider and a return that must say <em>paid</em> before the webhook has arrived, a webhook that must not be believed blindly, test and live keys that must never be mixed, refunds that have to find their way back, and a list of currencies with their own rules. <code>kitloom/<wbr>payments</code> has Mollie and Square as gateways beside PayPal: the keys go on one settings page, and the shop takes them like any other way to pay.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user manages the payment settings reads the ways to pay (<code>payments_<wbr>methods</code>): each gateway and offline method, whether it is on, the currencies it takes, whether it refunds, which credentials are still empty, and whether its webhook still needs setting up in the gateway's dashboard. So it answers:</p>
<ul>
<li><em>&quot;Why does the checkout not offer Mollie?&quot;</em> — the API key is empty, or the method is off.</li>
<li><em>&quot;Is the Square webhook subscribed, or do we only find out when the payer comes back?&quot;</em></li>
<li><em>&quot;Can we take yen with Square, and in what unit?&quot;</em></li>
</ul>
<p>It never sees a key's value and changes nothing here: who is paid is decided on a page a person opens. For everything else in the shop it has the shop's own tools.</p>
<h2 id="mollie-one-key" tabindex="-1">Mollie: one key <a class="header-anchor" href="#mollie-one-key" aria-label="Permalink to &quot;Mollie: one key&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Payments → Settings</strong> shows every way to pay on one page. The Mollie section:</p>
<ol>
<li><strong>Enabled</strong> puts Mollie on the checkout; <strong>Title</strong> is what the payer sees there.</li>
<li><strong>API key</strong> from the Mollie dashboard, under <em>Developers → API keys</em>. There is no sandbox switch: a key starting with <code>test_</code> takes test payments, where Mollie shows a page to choose the outcome and no money moves, and a key starting with <code>live_</code> takes real ones once Mollie has approved the account. The key is kept encrypted with the application key and never shown back.</li>
<li><strong>The webhook needs nothing from you.</strong> There is no address to copy and nothing to register: the site gives Mollie its address with every payment. Mollie's notification only names the payment, unsigned, so the site fetches that payment from Mollie with your key and settles it by what Mollie says. A notification nobody at Mollie sent changes nothing.</li>
</ol>
<p>Which methods the payer is offered — card, iDEAL, Bancontact, SEPA, Klarna and the rest — is set in Mollie, under <em>Settings → Website profiles → Payment methods</em>, test and live each with their own list. The shop takes whatever you switched on there.</p>
<p>At the checkout the payer is sent to Mollie's page, picks a method, pays and comes back. The site asks Mollie at once, so the page they land on already says paid. A payment the payer cancelled, or one that expired unpaid, is cancelled; open and pending ones wait. A refund from the payment's screen goes back through Mollie, in full or in part, and Mollie pays it out with its next run; a refund made in Mollie's dashboard, or a chargeback, comes in by the same webhook and is recorded on the payment once.</p>
<p><strong>Currencies</strong>: AUD, BGN, BRL, CAD, CHF, CZK, DKK, EUR, GBP, HKD, HUF, ILS, ISK, JPY, MXN, NOK, NZD, PHP, PLN, RON, SEK, SGD, TWD, USD and ZAR; JPY and ISK in whole units. iDEAL, Bancontact and SEPA take euros only, and Mollie offers the payer the methods that take the payment's currency.</p>
<h2 id="square-a-token-a-location-one-subscription" tabindex="-1">Square: a token, a location, one subscription <a class="header-anchor" href="#square-a-token-a-location-one-subscription" aria-label="Permalink to &quot;Square: a token, a location, one subscription&quot;">&ZeroWidthSpace;</a></h2>
<p>The Square section of the same page:</p>
<ol>
<li><strong>Access token</strong> from your application on developer.squareup.com, under <em>Credentials</em>. The switch at the top there says <em>Sandbox</em> or <em>Production</em>, each with its own token. Kept encrypted, never shown back.</li>
<li><strong>Location ID</strong> from <em>Locations</em> in the same application, or from the Square Dashboard under <em>Settings → Locations</em>: the shop the payments go to. A location takes payments in its own country's currency only — a US location, dollars.</li>
<li><strong>sandbox</strong> on goes with the Sandbox token: test payments with Square's test card numbers, no money moves. For the real shop paste the Production token and turn it off. A token of one with the switch of the other is refused as unauthorized, which is the first thing to check when nothing works.</li>
<li><strong>The webhook.</strong> Square tells the site when a payment completes or a refund settles, even if the payer closed the tab. Copy the <strong>Webhook address</strong> the page shows, add a subscription with it under <em>Webhooks → Subscriptions</em> in the application — Sandbox or Production, as the token — with the <code>payment.<wbr>created</code>, <code>payment.<wbr>updated</code>, <code>refund.<wbr>created</code> and <code>refund.<wbr>updated</code> events, and paste the subscription's <strong>Signature key</strong> back. Every notification is checked against it; without it every notification is refused and Square tries again for a while. Sandbox and Production need a subscription each.</li>
</ol>
<p>Save, and Square is a way to pay. The payer is sent to a Square checkout page for the amount, pays by card or a wallet Square offers there, and comes back; the site reads the order from Square there and then. A card Square declined leaves the link open, so the payer may try another card on it; a link nobody paid within a day is cancelled by the reconciliation, and one paid late after all is paid. A refund from the payment's screen goes back to the Square payment, waits while the card network has it, and is settled by Square's <code>refund.<wbr>updated</code>.</p>
<p><strong>Currencies</strong>: USD, CAD, GBP, EUR, AUD and JPY — Square's markets, each in the location's own currency; JPY in whole yen.</p>
<h2 id="test-first-live-when-ready" tabindex="-1">Test first, live when ready <a class="header-anchor" href="#test-first-live-when-ready" aria-label="Permalink to &quot;Test first, live when ready&quot;">&ZeroWidthSpace;</a></h2>
<p>Both gateways start in test: a <code>test_</code> key at Mollie, the Sandbox token and switch at Square. The checkout works end to end, orders are placed and marked paid, refunds go back, and no money moves. Going live is pasting the live key or the Production token on the same page, with no deploy: what is saved there wins over <code>config/<wbr>billing.<wbr>php</code> and the environment.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>Mollie is on Mollie's Payments API v2, Square on Square's Checkout API (payment links), both through Laravel's HTTP client, no SDK. Payments are for any model, not only the shop's orders: an invoice or a booking implements <code>Payable</code>, takes the <code>Has<wbr>Payments</code> trait, and sends the payer on its way.</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $order</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">pay</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'mollie'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">redirect</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();   </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// or 'square': on the return the payment is settled and $order->paid() is called</span></span></code></pre>
</div><p>The engine underneath is <a href="https://github.com/fomvasss/laravel-billing" target="_blank" rel="noreferrer">fomvasss/laravel-billing</a> with its payments table and its other gateways — Stripe, Paddle, Monobank, LiqPay, WayForPay, Hutko. Each payment fires <code>Payment<wbr>Paid</code>, <code>Payment<wbr>Failed</code>, <code>Payment<wbr>Canceled</code> and <code>Payment<wbr>Refunded</code> with the payment and its payable; fulfil on <code>Payment<wbr>Paid</code>, never on the payer's return. The webhooks run on the queue, and pending payments past their link's lifetime are reconciled every fifteen minutes by the scheduler. It comes with both admins, Filament and Nova.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>Two short lessons from the admin, narrated:</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/payments/filament/mollie.jpg" src="https://media.kitloom.dev/lessons/payments/filament/mollie.mp4"></video>
  <figcaption>Take payments with Mollie: one key, test or live by its prefix, no webhook to register</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/payments/filament/square.jpg" src="https://media.kitloom.dev/lessons/payments/filament/square.mp4"></video>
  <figcaption>Take payments with Square: the token and the location, Sandbox or Production, the webhook subscription</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail of both gateways — the outcomes, refunds, the currencies, the agent's tool — is in the <a href="https://kitloom.dev/docs/modules/guides/payments.html">Payments guide</a>; PayPal has a post of its own, <a href="https://kitloom.dev/blog/paypal-in-a-laravel-shop.html">Accept PayPal in a Laravel shop</a>, and how the shop came over from WooCommerce is in <a href="https://kitloom.dev/blog/woocommerce-to-laravel.html">WooCommerce to Laravel</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Accept PayPal in a Laravel shop that runs on a WordPress database</title>
      <link>https://kitloom.dev/blog/paypal-in-a-laravel-shop.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/paypal-in-a-laravel-shop.html</guid>
      <pubDate>Sun, 01 Nov 2026 12:00:00 GMT</pubDate>
      <description>PayPal checkout for a Laravel shop: the REST app's keys and webhook pasted in the admin, Sandbox first and Live when ready, the order captured on return, refunds back to the transaction, 24 currencies.</description>
      <content:encoded><![CDATA[<p>The shop moved from WooCommerce to Laravel and kept its orders, its products and its customers. Stripe takes cards. Then the first customer writes: <em>&quot;Do you take PayPal?&quot;</em> Half the shoppers in North America and Europe would rather approve a payment in an account they already have than type a card into a site they met today, and a shop without the button loses some of them at the last step.</p>
<p>On a Laravel site PayPal is a small project of its own: the REST API's approve-and-return dance, a capture that must happen exactly once even when the payer closes the tab, a webhook PayPal must be asked to verify, refunds that have to find their way back to the transaction, and twenty-four currencies of which three are paid in whole units. <code>kitloom/<wbr>payments</code> has PayPal as a gateway: the keys and the webhook go on a settings page, and the shop takes PayPal like any other way to pay.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user manages the payment settings reads the ways to pay (<code>payments_<wbr>methods</code>): each gateway and offline method, whether it is on, the currencies it takes, which credentials are still empty, and whether its webhook still needs setting up in the gateway's dashboard. So it answers:</p>
<ul>
<li><em>&quot;Why does the checkout not offer PayPal?&quot;</em> — the Secret is empty, or the method is off.</li>
<li><em>&quot;Is the PayPal webhook set up, or are we only capturing on return?&quot;</em></li>
<li><em>&quot;Which of our methods refund from the order page?&quot;</em></li>
</ul>
<p>It never sees a key's value and changes nothing here: who is paid is decided on a page a person opens. For everything else in the shop — orders, products, coupons — it has the shop's own tools.</p>
<h2 id="set-up-in-the-admin" tabindex="-1">Set up in the admin <a class="header-anchor" href="#set-up-in-the-admin" aria-label="Permalink to &quot;Set up in the admin&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Payments → Settings</strong> shows every way to pay on one page, the online gateways and the offline methods. The PayPal section:</p>
<ol>
<li><strong>Enabled</strong> puts PayPal on the checkout; <strong>Title</strong> is what the payer sees there, <em>PayPal</em> unless you say otherwise.</li>
<li><strong>Client ID</strong> and <strong>Secret</strong> from a REST app on developer.paypal.com, under <em>Apps &amp; Credentials</em>. The secret is kept encrypted with the application key and never shown back; an empty field later keeps the one saved.</li>
<li><strong>sandbox</strong> on means the Sandbox app: test payments with the sandbox personal accounts PayPal made for you, no money moves. When the shop goes live, paste the Live app's keys and turn it off. Keys of one with the switch of the other fail with PayPal's <em>Client Authentication failed</em>, which is the first thing to check.</li>
<li><strong>The webhook.</strong> Copy the <strong>Webhook address</strong> the page shows, add it under the app's <em>Webhooks</em> on developer.paypal.com with the checkout and payment capture events ticked, and paste the <strong>Webhook ID</strong> PayPal shows back. Every notification is then verified with PayPal against that id; without it every notification is refused and PayPal keeps trying for a few days. A sandbox app needs a webhook of its own.</li>
</ol>
<p>Save, and PayPal is a way to pay at the checkout.</p>
<h2 id="what-happens-at-the-checkout" tabindex="-1">What happens at the checkout <a class="header-anchor" href="#what-happens-at-the-checkout" aria-label="Permalink to &quot;What happens at the checkout&quot;">&ZeroWidthSpace;</a></h2>
<p>The payer picks PayPal, is sent to PayPal to approve, and comes back. The order is captured there and then: the page they land on already says paid, the shop's &quot;order received&quot; email goes out, and the invoice, if the <a href="https://kitloom.dev/blog/woocommerce-pdf-invoices-in-laravel.html">Invoices</a> module is on, is made.</p>
<p>A payer who closes the tab at PayPal does not leave an order half paid. The webhook captures it when PayPal reports the approval, and an hour on the reconciliation of pending payments asks PayPal about any it has not heard of. Whichever gets there first captures, and the order is announced paid once.</p>
<p>A refund from the order page goes back to the PayPal transaction, in full or in part, as with every other gateway. A refund made in PayPal itself, or a dispute PayPal decided for the buyer, comes in by the webhook and is recorded on the payment. The payment's reference is PayPal's transaction id, as PayPal's activity lists it, so the two sides reconcile.</p>
<p><strong>Currencies</strong>: AUD, BRL, CAD, CHF, CNY, CZK, DKK, EUR, GBP, HKD, HUF, ILS, JPY, MXN, MYR, NOK, NZD, PHP, PLN, SEK, SGD, THB, TWD and USD. HUF, JPY and TWD are paid in whole units: an amount with a fraction in them is refused before the payer is sent anywhere, not at PayPal's door. Which of them your account takes depends on its country.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>PayPal is a gateway of <code>kitloom/<wbr>payments</code>, on PayPal's REST API (Orders v2) through Laravel's HTTP client, no SDK. Payments are for any model, not only the shop's orders: an invoice or a booking implements <code>Payable</code>, takes the <code>Has<wbr>Payments</code> trait, and sends the payer on its way.</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $order</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">pay</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'paypal'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">redirect</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();   </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// to PayPal; on the return the payment is captured and $order->paid() is called</span></span></code></pre>
</div><p>The engine underneath is <a href="https://github.com/fomvasss/laravel-billing" target="_blank" rel="noreferrer">fomvasss/laravel-billing</a> with its payments table and its other gateways — Stripe, Paddle, Monobank, LiqPay, WayForPay, Hutko. The keys saved on the settings page win over <code>config/<wbr>billing.<wbr>php</code> and the environment, so a site is moved from Sandbox to Live without a deploy. It comes with both admins, Filament and Nova.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>A short lesson from the admin, narrated:</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/payments/filament/paypal.jpg" src="https://media.kitloom.dev/lessons/payments/filament/paypal.mp4"></video>
  <figcaption>Take PayPal payments: the keys, Sandbox or Live, the webhook</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail of the gateway — the webhook's events, refunds, the agent's tool — is in the <a href="https://kitloom.dev/docs/modules/guides/payments.html">Payments guide</a>; how the shop itself came over from WooCommerce is in <a href="https://kitloom.dev/blog/woocommerce-to-laravel.html">WooCommerce to Laravel</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Sell digital products in Laravel: private files, download limits and expiry</title>
      <link>https://kitloom.dev/blog/sell-digital-products-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/sell-digital-products-in-laravel.html</guid>
      <pubDate>Sun, 01 Nov 2026 12:00:00 GMT</pubDate>
      <description>kitloom's shop serves digital products: files kept out of the public folder, WooCommerce's download links and limits, a Downloads section for buyers, and a way to help one whose link ran out.</description>
      <content:encoded><![CDATA[<p>A shop that sells files has one job the rest of the shop does not: the file has to reach whoever paid and nobody else. The link goes into an email, the email gets forwarded, and a mail scanner opens it before the buyer does. Then the buyer writes in, and someone has to help them without touching the database.</p>
<p>kitloom's shop now does all of that, on WooCommerce's own data. A product brought over keeps its files, a customer keeps their permissions, and a link from an old email keeps working.</p>
<h2 id="where-the-file-lives" tabindex="-1">Where the file lives <a class="header-anchor" href="#where-the-file-lives" aria-label="Permalink to &quot;Where the file lives&quot;">&ZeroWidthSpace;</a></h2>
<p>An uploaded file goes to a folder outside the public one, or to a disk you name with <code>SHOP_<wbr>DOWNLOADS_<wbr>DISK</code>. The only way to it is a buyer's link. <code>kitloom/<wbr>backup</code> takes that folder along with the uploads, so a backup does not lose what you sell.</p>
<p>A file can also sit at an address elsewhere. The buyer is then sent there and sees that address, and the form says so.</p>
<p>WooCommerce keeps its files in <code>uploads/<wbr>woocommerce_<wbr>uploads</code> behind an <code>.<wbr>htaccess</code>, which nginx does not read, so on many servers anyone with the address gets the file. <code>php artisan shop:<wbr>downloads-<wbr>secure</code> says what would move, and with <code>--<wbr>apply</code> moves it to the private folder. Buyers keep their links and what they have left.</p>
<h2 id="limits-that-hold" tabindex="-1">Limits that hold <a class="header-anchor" href="#limits-that-hold" aria-label="Permalink to &quot;Limits that hold&quot;">&ZeroWidthSpace;</a></h2>
<p>The link is WooCommerce's, <code>/<wbr>?download_<wbr>file=…</code>, and a limit and an expiry work as they do there. The tests run the same order through a real WooCommerce and through kitloom: the count, what is left and the log come out the same.</p>
<p>kitloom is stricter in three places, on purpose. WooCommerce does not check a request for part of a file, so a <code>Range</code> header gets past its limit; here a download resumed within half an hour is the same download, and after that it needs one left. A path elsewhere on the server is refused, so a stored value cannot hand out <code>.<wbr>env</code>. And a refunded variation loses its files, which WooCommerce leaves in place.</p>
<h2 id="what-the-buyer-sees" tabindex="-1">What the buyer sees <a class="header-anchor" href="#what-the-buyer-sees" aria-label="Permalink to &quot;What the buyer sees&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Downloads</strong> in the account, the order's page, &quot;order received&quot;, and the customer's emails. A file that ran out stays listed with why and without a link, so a file someone paid for does not silently vanish. Every theme with an account draws it, and a new one gets it from the generator.</p>
<div class="lesson-videos lesson-videos-single">
<figure class="lesson-video">
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/shop/filament/digital-products.jpg" src="https://media.kitloom.dev/lessons/shop/filament/digital-products.mp4#t=3"></video>
  <figcaption>Sell a file: a downloadable product, its limit and its expiry</figcaption>
</figure>
</div>
<h2 id="when-a-buyer-writes-in" tabindex="-1">When a buyer writes in <a class="header-anchor" href="#when-a-buyer-writes-in" aria-label="Permalink to &quot;When a buyer writes in&quot;">&ZeroWidthSpace;</a></h2>
<p>An order with a file shows what the buyer has of each one. <strong>Give back</strong> adds a download, <strong>Change</strong> sets what is left and the last day, <strong>Revoke</strong> ends the link, and <strong>Grant access</strong> gives an old order a file added since. Each leaves a note on the order. The link is there to copy and not to open, because a click from the admin would use up a download.</p>
<div class="lesson-videos lesson-videos-single">
<figure class="lesson-video">
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/shop/filament/download-permissions.jpg" src="https://media.kitloom.dev/lessons/shop/filament/download-permissions.mp4#t=3"></video>
  <figcaption>Help a buyer with a download: what is left, the last day, access</figcaption>
</figure>
</div>
<p>An AI agent connected to the site can change what is left and the last day with <code>order_<wbr>download_<wbr>update</code>, and set a product's files with <code>product_<wbr>save</code>. It never sees a customer's link, and it deletes nothing: taking a file away is <code>remaining:<wbr> 0</code>, which a person can undo.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. The <a href="https://kitloom.dev/docs/modules/guides/shop.html">shop's guide</a> has the details, and <a href="https://kitloom.dev/blog/woocommerce-to-laravel.html">moving from WooCommerce</a> covers the rest of a shop.</p>
]]></content:encoded>
    </item>
    <item>
      <title>SMS and WhatsApp booking confirmations in Laravel, without code</title>
      <link>https://kitloom.dev/blog/sms-whatsapp-booking-confirmations-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/sms-whatsapp-booking-confirmations-in-laravel.html</guid>
      <pubDate>Sun, 01 Nov 2026 12:00:00 GMT</pubDate>
      <description>Text a booking confirmation, a reminder the day before and an order receipt from a Laravel site through Twilio or Vonage: set up in the admin, every text logged, STOP honoured, WhatsApp by approved templates.</description>
      <content:encoded><![CDATA[<p>A client books a haircut for next Tuesday. The confirmation email lands in a folder they never open, Tuesday comes, and the chair stays empty. A customer orders at ten in the evening and wonders until morning whether the order went through. Both would have read a text within a minute: a text is what cuts no-shows, and what tells a customer the shop heard them.</p>
<p>Sending one from Laravel is a few lines against Twilio's API. Sending them from a site is the rest: which events deserve a text and to whom, the phone a client typed with no country code, the delivery receipt that says it arrived, the law that says a STOP must be obeyed, the template Meta must approve before a business may write first on WhatsApp, a log the front desk can read, and what to do when the provider refuses ten texts in a row because the balance ran out. <code>kitloom/<wbr>text-<wbr>messages</code> is that work done once, for the bookings, the shop and the owner's own notifications.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user manages the texts answers from the log and acts on it:</p>
<ul>
<li><em>&quot;Did Anna get her reminder for Tuesday?&quot;</em> (<code>text_<wbr>messages_<wbr>list</code>)</li>
<li><em>&quot;Why did yesterday's confirmations fail?&quot;</em> — the provider's own words are on each row.</li>
<li><em>&quot;Mrs. Lee asked on the phone not to be texted any more.&quot;</em> (<code>text_<wbr>messages_<wbr>opt_<wbr>out</code>)</li>
<li><em>&quot;Send a test to my phone, I just changed the number.&quot;</em> (<code>text_<wbr>messages_<wbr>send_<wbr>test</code>)</li>
</ul>
<p>The Twilio or Vonage keys stay on the Settings page, encrypted, where a person pastes them; an agent never sees them and cannot change where the texts come from.</p>
<h2 id="what-is-texted" tabindex="-1">What is texted <a class="header-anchor" href="#what-is-texted" aria-label="Permalink to &quot;What is texted&quot;">&ZeroWidthSpace;</a></h2>
<p>Each text goes to the phone the person typed on the booking form or at the checkout, beside the email, in the language they booked or ordered in. Nothing replaces the emails: they go on as before, the text is the one that gets read.</p>
<table tabindex="0">
<thead>
<tr>
<th>From</th>
<th>Text</th>
<th>To</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bookings</td>
<td>received, confirmed, a reminder the hours before the visit (as Bookings → Settings say), declined, cancelled</td>
<td>the client</td>
</tr>
<tr>
<td>Bookings</td>
<td>a new booking, with a link to confirm it; a cancellation</td>
<td>the staff member's phone, from their card in Bookings → Staff</td>
</tr>
<tr>
<td>Shop</td>
<td>order received (when the shop's own &quot;new order&quot; email goes), completed, cancelled, refunded with the amount</td>
<td>the billing phone</td>
</tr>
<tr>
<td>Notifications</td>
<td>the owner's news — a new order, a failed backup — on a channel of type SMS or WhatsApp in Notifications → Channels</td>
<td>your phone</td>
</tr>
</tbody>
</table>
<p>Each group is a switch under <strong>What is texted</strong>, on from the start. The words are the module's, in the site's language: <em>Marginalia: your Haircut on Tue 3 Nov 10:00 is confirmed. Manage: https://…/booking/7KQ2MN/…</em>. The links are short ones that open the same pages as the emails' buttons.</p>
<p>Not texted, on purpose: the &quot;time to book again&quot; email, comments, form messages, low stock. Those are marketing or the owner's business, and a marketing text needs a consent of its own.</p>
<h2 id="set-up-in-the-admin" tabindex="-1">Set up in the admin <a class="header-anchor" href="#set-up-in-the-admin" aria-label="Permalink to &quot;Set up in the admin&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Text Messages → Settings</strong>, in a few minutes:</p>
<ol>
<li><strong>The provider.</strong> Twilio, most used in North America, or Vonage, strong in Europe; both are set up the same way. On Twilio's console front page: the Account SID and the Auth token; under Phone Numbers, the number the texts come from. A trial account texts only the numbers you verified.</li>
<li><strong>The keys.</strong> The Account SID, the auth token, the number as the <strong>SMS sender</strong> in international form. The token is kept encrypted with the application key and never shown again: an empty field later keeps the one saved. Where the country allows it, a name of up to eleven letters can send instead of a number; Canada and the US do not.</li>
<li><strong>The webhooks.</strong> The page shows two addresses. The <strong>Status URL</strong> is how Twilio or Vonage tell the site a text was delivered; the <strong>Inbound URL</strong>, pasted under <em>A message comes in</em> on the number, is how the site hears STOP, START and the replies. Every call is signed by the provider and the site answers only the signed ones.</li>
<li><strong>Country</strong>, two letters, says what a phone typed without its plus code means. Without it, only numbers with a code are texted: a guessed prefix would text a stranger.</li>
<li><strong>Send a test</strong> to a phone of yours. Twilio takes it, the notice says it is on its way, and <strong>Messages</strong> shows whether it was delivered.</li>
</ol>
<p><strong>Text Messages → Messages</strong> is the log: every text the site sent or received, newest first — when, sent or received, the phone, what it was about, SMS or WhatsApp, and its status. <em>Delivered</em> is the provider's receipt. <em>Failed</em> carries the provider's words, so a landline typed as a mobile is found at a glance and the client asked for another number; the email reminder went out all the same. Opening a text shows the words as sent, how many SMS parts they took, the provider's id to find it in Twilio, and the booking it was about.</p>
<h2 id="stop-and-the-law" tabindex="-1">STOP, and the law <a class="header-anchor" href="#stop-and-the-law" aria-label="Permalink to &quot;STOP, and the law&quot;">&ZeroWidthSpace;</a></h2>
<p>What the site texts is the person's own transaction — the booking they made, the order they placed — which Canada's anti-spam law and the US TCPA treat as consented to by the transaction itself. Still, a person who answers <strong>STOP</strong> (or UNSUBSCRIBE, CANCEL, ARRET…) is texted nothing more on that channel: each text to them is logged <em>Said STOP</em> instead, until they answer <strong>START</strong>. A client who asks in person goes on the list by hand, <strong>Stop texting a number</strong> in Messages; the same button takes them off. The emails keep going either way.</p>
<h2 id="whatsapp-kind-by-kind" tabindex="-1">WhatsApp, kind by kind <a class="header-anchor" href="#whatsapp-kind-by-kind" aria-label="Permalink to &quot;WhatsApp, kind by kind&quot;">&ZeroWidthSpace;</a></h2>
<p>A business may write first on WhatsApp only with a template Meta approved, with numbered blanks the site fills. So WhatsApp works kind by kind: switch <strong>Send WhatsApp</strong> on, name the WhatsApp Business number, and paste an approved template's id next to each kind under <strong>WhatsApp templates</strong> — a kind left empty goes by SMS. The guide lists the blanks each kind fills, in order, so the templates are written right the first time; Meta's approval takes from a day to a few.</p>
<h2 id="when-the-provider-says-no" tabindex="-1">When the provider says no <a class="header-anchor" href="#when-the-provider-says-no" aria-label="Permalink to &quot;When the provider says no&quot;">&ZeroWidthSpace;</a></h2>
<p>A text is sent from the queue: a provider that is busy gets it again, three tries; one that refuses it gets it no more. Ten refusals in a row — a wrong key, an empty balance — turn sending off: bookings and orders go by email only, the administrator gets an email, and Site Health says so. Fix it, press <strong>Send a test</strong>, and a text that gets through turns sending back on.</p>
<p>The log keeps the words for ninety days (Settings says how long); the rows stay for the counts. Export and Erase Personal Data cover the texts of a person's phone; a STOP is kept, since forgetting it would let the site text them again.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>Bookings, the shop and the notifications never name this module. They text through a contract in the core, <code>Kitloom\<wbr>Wp<wbr>Schema\<wbr>Messaging\<wbr>Text<wbr>Messenger</code>, and Laravel's own notifications: a notification adds <code>Text<wbr>Channel::<wbr>class</code> beside <code>mail</code> and answers <code>to<wbr>Text()</code> with the words. A module of your own does the same:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> via</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">object</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $notifiable)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> array_filter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'mail'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">$this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">texts</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">channels</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'review.reply'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> TextChannel</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> :</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> toText</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">object</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $notifiable)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ?</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">OutgoingText</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> new</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> OutgoingText</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Your review got a reply: :url'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'url'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">url]), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">kind</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'review.reply'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>Without the module nothing is texted and nothing breaks; <code>channels($kind)</code> says whether the owner texts that kind at all. The module reaches Twilio and Vonage on Laravel's HTTP client, one call each, no SDK; a third provider is one class. The log is a table of its own with an Eloquent model you can swap, and tests fake the texts with <code>Fakes<wbr>Texts</code>. It comes with both admins, Filament and Nova.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>Two short lessons from the admin, narrated:</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/text-messages/filament/settings.jpg" src="https://media.kitloom.dev/lessons/text-messages/filament/settings.mp4"></video>
  <figcaption>Connect Twilio: the keys, the sender, the webhooks, what is texted, a test</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/text-messages/filament/messages.jpg" src="https://media.kitloom.dev/lessons/text-messages/filament/messages.mp4"></video>
  <figcaption>The log: delivered, failed and why, a STOP texted back, a number kept off by hand</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>The module comes with kitloom, for either admin. On a Filament site:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/text-messages</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/text-messages-filament</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> migrate</span></span></code></pre>
</div><p>On a Nova site, the second package is <code>kitloom/<wbr>text-<wbr>messages-<wbr>nova</code>. Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail — Vonage, the WhatsApp templates' blanks, the agent's tools — is in the <a href="https://kitloom.dev/docs/modules/guides/text-messages.html">Text Messages guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Zoom meetings for online bookings in Laravel, made by the site</title>
      <link>https://kitloom.dev/blog/zoom-meetings-for-online-bookings-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/zoom-meetings-for-online-bookings-in-laravel.html</guid>
      <pubDate>Sun, 01 Nov 2026 12:00:00 GMT</pubDate>
      <description>Every confirmed online booking on a Laravel site gets its own Zoom meeting: the client's join link in the confirmation, the reminder, the calendar file and their account, the staff member's start link in their email. One Server-to-Server OAuth app, set up once.</description>
      <content:encoded><![CDATA[<p>A consultation is booked for Thursday at four. Wednesday evening the consultant opens Zoom, schedules a meeting, copies the link into an email, finds the client's address in the booking, and sends it. Thursday at four the client is searching their inbox for it. One of ten bookings is moved; the link in the email is now for the wrong hour. A salon that sees twenty clients online a week spends an afternoon on links, and the one it forgets is the one that calls.</p>
<p>Zoom's API will make a meeting; what takes the time on a Laravel site is everything around it: an app at Zoom that nobody has to sign in to, a meeting made the moment a booking is confirmed and not a second before, moved when the booking moves, deleted when it is cancelled, a link that reaches the client wherever they look and a start link that reaches only the staff member, and what to do when Zoom is down at the moment of confirmation. <code>kitloom/<wbr>booking-<wbr>meetings</code> is that work done once, as a module of <a href="https://kitloom.dev/docs/modules/guides/bookings.html">kitloom/bookings</a>.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user manages the meetings reads and makes them:</p>
<ul>
<li><em>&quot;Send me the Zoom link of Ada's call on Tuesday.&quot;</em> (<code>booking_<wbr>meetings_<wbr>list</code> — the meetings and their links, by booking code or dates)</li>
<li><em>&quot;The meeting for booking 7KQ2MN failed; make it again.&quot;</em> (<code>booking_<wbr>meetings_<wbr>create</code>)</li>
<li><em>&quot;Does Zoom still take our credentials?&quot;</em> (<code>booking_<wbr>meetings_<wbr>check</code>)</li>
</ul>
<p>Connecting Zoom and choosing the services stay in the admin, and the start link — the salon's key to the meeting — is shown to nobody without the permission to manage bookings.</p>
<h2 id="set-up-once-at-zoom" tabindex="-1">Set up once at Zoom <a class="header-anchor" href="#set-up-once-at-zoom" aria-label="Permalink to &quot;Set up once at Zoom&quot;">&ZeroWidthSpace;</a></h2>
<p>One app for the site, made once by the owner or an admin of the Zoom account; it takes ten minutes and never expires. Nobody signs in to Zoom from the site, and no staff member needs a Zoom account: the meetings are made on the salon's.</p>
<ol>
<li>At <a href="https://marketplace.zoom.us/" target="_blank" rel="noreferrer">marketplace.zoom.us</a>, with the salon's account: <em>Develop → Build App</em>, a <strong>Server-to-Server OAuth App</strong>, a name such as <em>Bookings</em>.</li>
<li><em>App Credentials</em> shows three values: <strong>Account ID</strong>, <strong>Client ID</strong> and <strong>Client Secret</strong>.</li>
<li><em>Scopes → Add Scopes → Meeting</em>: the four meeting scopes, to make, read, move and delete a meeting. An app made a while ago shows the older names instead; either set does.</li>
<li><em>Activation → Activate your app.</em></li>
<li>In the admin, <strong>Zoom Meetings → Settings</strong>: paste the three values under <em>Connect Zoom</em>, save, then press <strong>Check access</strong>. <em>Zoom takes the credentials</em> means it is done; otherwise Zoom's own words, or the scopes the app still lacks, so a missing one is named rather than found at the first booking. The secret is kept encrypted with the application key and never shown back.</li>
</ol>
<p>Then, under <em>Video calls</em>: <strong>Make a Zoom meeting for every confirmed booking</strong> on, <strong>Only for these services</strong> for a salon that also sees clients in person — <em>Video consultation</em> alone, and only its bookings get a meeting — and the <strong>Waiting room</strong>, on, so the client waits until the staff member lets them in.</p>
<h2 id="what-the-client-gets" tabindex="-1">What the client gets <a class="header-anchor" href="#what-the-client-gets" aria-label="Permalink to &quot;What the client gets&quot;">&ZeroWidthSpace;</a></h2>
<p>A booking gets its meeting when it is confirmed: at once, when the salon confirms bookings at once, or when the staff member confirms it. From then on:</p>
<ul>
<li><strong>The confirmation email and the reminder</strong> have a <em>Join the video call</em> button above <em>Manage booking</em>, and the passcode in the details. The link carries the passcode already.</li>
<li><strong>The calendar file</strong> carries the link as the event's link — the <em>Join</em> button of Google, Apple and Outlook calendars — and, when the salon has no address set, as the event's place too.</li>
<li><strong>The text messages</strong> of the confirmation and the reminder end with the link, with <a href="https://kitloom.dev/blog/sms-whatsapp-booking-confirmations-in-laravel.html">kitloom/text-messages</a>.</li>
<li><strong>The account page</strong>, under <em>Appointments</em>, shows the link beside each upcoming confirmed booking, and so does the page the email's link opens.</li>
</ul>
<p>The meeting is named after the service and the staff member — <em>Consultation with Mira</em> — and its description is the booking's code and the site's name: nothing of the client goes to Zoom.</p>
<p>The staff member gets the other link. <em>Start the video call</em> is in their new-booking email when the booking is confirmed already, on the page of their Confirm button once they confirm, and on their <em>Schedule</em> beside each confirmed booking of the day. It opens the meeting as its host, and it is never shown to the client.</p>
<h2 id="when-the-booking-changes" tabindex="-1">When the booking changes <a class="header-anchor" href="#when-the-booking-changes" aria-label="Permalink to &quot;When the booking changes&quot;">&ZeroWidthSpace;</a></h2>
<p>Moved to another time, service or staff member, the booking moves its meeting in Zoom, and the link stays the same, so what the client was sent still works. Moved to a service not held online, the meeting is deleted. Cancelled, declined or marked a no-show, it is deleted in Zoom, and Zoom sends nobody an email about it. Marked done, it is kept as history.</p>
<h2 id="when-zoom-does-not-answer" tabindex="-1">When Zoom does not answer <a class="header-anchor" href="#when-zoom-does-not-answer" aria-label="Permalink to &quot;When Zoom does not answer&quot;">&ZeroWidthSpace;</a></h2>
<p>Zoom is called from the queue, three tries with a pause between. A call that still fails lands on the meeting's row in <strong>Zoom Meetings → Meetings</strong> with Zoom's words, and the booking goes on without the link: a booking is never refused because Zoom did not answer. From the row, <strong>Create again</strong> after fixing the cause, or <strong>Delete in Zoom</strong> for a meeting nobody needs. Site Health warns while the meetings are switched on without Zoom connected and while meetings of bookings still to come are failing, and the notification topic <em>Zoom meeting failed</em> tells a Telegram, Slack or browser channel which booking, what was asked and what Zoom said.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>Zoom is reached on Laravel's HTTP client, no SDK, with the Server-to-Server OAuth token kept in the cache for most of its hour. The meetings are a table of the module's own, <code>booking_<wbr>meetings</code>, one row per booking and gone with it, on an Eloquent model the application can swap through the <code>Model<wbr>Registry</code>. A cache lock per booking keeps the queue's job and the confirmation email from making two meetings: if the email goes out before the queue got to it, the email makes the meeting, and the queue finds it made.</p>
<p>The bookings module never names Zoom. The link reaches it through its <code>Meeting<wbr>Link</code> contract: a module answers <code>meeting($booking, $for<wbr>Staff)</code> with the address, a label and the passcode, or null, and the bookings put it into the emails, the calendar file, the page and the account. Google Meet or Microsoft Teams would be a module of their own on the same contract. Tests fake Zoom with <code>Fakes<wbr>Zoom</code>. It comes with both admins, Filament and Nova.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>A short lesson from the admin, narrated:</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/booking-meetings/filament/settings.jpg" src="https://media.kitloom.dev/lessons/booking-meetings/filament/settings.mp4"></video>
  <figcaption>Zoom meetings for bookings: the app's three values pasted once, Check access, the services held online, a confirmed booking with its link</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>The module comes with kitloom, for either admin. On a Filament site with bookings:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/booking-meetings</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/booking-meetings-filament</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> migrate</span></span></code></pre>
</div><p>On a Nova site, the second package is <code>kitloom/<wbr>booking-<wbr>meetings-<wbr>nova</code>. Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail — the scopes, what each email carries, the agent's tools, the settings — is in the <a href="https://kitloom.dev/docs/modules/guides/booking-meetings.html">Zoom Meetings guide</a>; the bookings themselves, and the staff's Google Calendars, in <a href="https://kitloom.dev/blog/google-calendar-sync-for-bookings-in-laravel.html">Google Calendar sync for bookings</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Ads on a Laravel site: AdSense, your own banners and a product feed, without a plugin</title>
      <link>https://kitloom.dev/blog/laravel-ads-adsense-banners-product-feed.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/laravel-ads-adsense-banners-product-feed.html</guid>
      <pubDate>Sat, 31 Oct 2026 12:00:00 GMT</pubDate>
      <description>Run ads on a Laravel site: AdSense and Google Ad Manager behind consent, your own banners in turn with views and clicks, ads.txt, a Google Merchant Center feed, and an AI agent that manages them.</description>
      <content:encoded><![CDATA[<p>A local bookshop wants the space after the second paragraph of your posts, from Monday to Friday. Your sidebar should carry AdSense, but only for visitors who said yes to marketing cookies. And the shop's products should run in Google Shopping, which wants them in a file it can fetch.</p>
<p>On a Laravel site, each of these is a small project: a table for banners, something to rotate them, a script tag that respects consent, a route for <code>ads.<wbr>txt</code>, a job for the feed. And the rotation fights the page cache, which keeps one page for every visitor. kitloom/ads does all of it as one module, from the admin.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent works on your ads with the rights of the user whose key it holds:</p>
<ul>
<li><em>&quot;Put this new banner after the second paragraph of posts, until Friday.&quot;</em> (<code>ads_<wbr>create</code>, <code>ad_<wbr>zones_<wbr>create</code>)</li>
<li><em>&quot;Pause the spring sale banners.&quot;</em> (<code>ads_<wbr>list</code>, <code>ads_<wbr>update</code>)</li>
<li><em>&quot;Which ad got the most clicks this month?&quot;</em> (<code>ads_<wbr>stats</code>)</li>
<li><em>&quot;Which products did the Merchant Center feed leave out, and why?&quot;</em> (<code>ads_<wbr>feed_<wbr>status</code>)</li>
</ul>
<p>Nothing is deleted: an agent pauses instead. An HTML ad runs on every visitor's page, so it needs its own permission, for an agent's user as for anyone else. The AdSense publisher ID stays on the Settings page for people to change, because it decides who is paid. Every change goes through the same writer as the admin's, with the agent's user as the actor.</p>
<h2 id="an-ad-and-a-zone" tabindex="-1">An ad and a zone <a class="header-anchor" href="#an-ad-and-a-zone" aria-label="Permalink to &quot;An ad and a zone&quot;">&ZeroWidthSpace;</a></h2>
<p>An <strong>ad</strong> is what is shown: an image with a link, your own HTML, an AdSense unit or a Google Ad Manager unit. It has a weight, and it can have dates.</p>
<p>A <strong>zone</strong> is where: the <em>Ad zone</em> widget in a sidebar, <code>[ad zone=&quot;sidebar&quot;]</code> in a text, a block, or by itself before a record's text, after it, or after its Nth paragraph, on the post types you tick. A paragraph inside a quote, a list or a table does not count, so an ad never breaks one in two.</p>
<p>Several ads in a zone take turns. A banner of weight 3 is shown three times as often as one of weight 1.</p>
<h2 id="it-works-with-the-page-cache" tabindex="-1">It works with the page cache <a class="header-anchor" href="#it-works-with-the-page-cache" aria-label="Permalink to &quot;It works with the page cache&quot;">&ZeroWidthSpace;</a></h2>
<p>The usual way to rotate banners is on the server, and a page cache then serves one banner to everyone until it expires. A Vue or React theme adds a second problem: it puts a widget's HTML in with <code>v-<wbr>html</code>, where a script never runs.</p>
<p>So the server draws every candidate of a zone in a <code>&lt;template&gt;</code>, and one script in the footer picks. It checks the dates and the screen width, asks about consent, and takes one by weight, for this visitor and this moment. A banner with a start date appears on time on a page cached yesterday. When an ad is paused or a zone changes, the pages that show it are drawn anew. A visitor seeing an ad draws nothing anew: counts stay out of the cache's way.</p>
<h2 id="adsense-ad-manager-and-consent" tabindex="-1">AdSense, Ad Manager and consent <a class="header-anchor" href="#adsense-ad-manager-and-consent" aria-label="Permalink to &quot;AdSense, Ad Manager and consent&quot;">&ZeroWidthSpace;</a></h2>
<p>Enter your publisher ID or network code on <strong>Ads → Settings</strong>, and make units with the IDs from your account. With auto ads on, AdSense loads on every page and Google places the ads.</p>
<p>With the Cookie Consent module, the networks and your own code wait for the visitor's consent to marketing, and a zone fills the moment they say yes. An image of your own sets no cookies, so it waits for nothing. Signed-in administrators and editors see no ads by default, and <em>No ads on this page</em> keeps a privacy policy free of them, auto ads included.</p>
<p><code>/<wbr>ads.<wbr>txt</code> serves the lines your networks give you, and adds AdSense's own line once the publisher ID is set. If you already use Site Kit by Google, <code>php artisan ads:<wbr>import</code> takes the publisher ID from it.</p>
<h2 id="views-and-clicks" tabindex="-1">Views and clicks <a class="header-anchor" href="#views-and-clicks" aria-label="Permalink to &quot;Views and clicks&quot;">&ZeroWidthSpace;</a></h2>
<p>The list of ads shows the views and clicks of the last 7 days, with the click rate. A view counts an ad at least half on the screen. A click counts the links of your own banners and code, and the link itself goes straight to the advertiser, marked <code>rel=&quot;sponsored nofollow&quot;</code>. For AdSense and Ad Manager, trust their own reports: the money is there.</p>
<p>The counts are per ad per zone per day and say nothing about who saw an ad, so there is no personal data to export or erase.</p>
<h2 id="a-feed-for-google-merchant-center-and-meta-catalog" tabindex="-1">A feed for Google Merchant Center and Meta Catalog <a class="header-anchor" href="#a-feed-for-google-merchant-center-and-meta-catalog" aria-label="Permalink to &quot;A feed for Google Merchant Center and Meta Catalog&quot;">&ZeroWidthSpace;</a></h2>
<p>With the <a href="https://kitloom.dev/docs/modules/guides/shop.html">Shop</a> module, <strong>Ads → Settings</strong> gives you the address of a feed: the file Google Merchant Center, Meta Catalog, Pinterest and Microsoft Merchant read. Paste it in as a scheduled feed.</p>
<p>Each simple product is one line and each enabled variation another, grouped under its product, with its price as the catalogue shows it, its stock, its pictures, and its GTIN when it has one. The scheduler builds it every six hours, or you press <em>Build the feed now</em>. What cannot be listed is left out with the reason, such as a product without a picture, so you can put it right before a network refuses it. The address holds a key, so your prices are not at an address anyone guesses.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>The module keeps its ads and zones in tables of its own, with Eloquent models you can swap in the <code>Model<wbr>Registry</code>. <code>Ad<wbr>Writer</code> and <code>Zone<wbr>Writer</code> take the acting user and announce <code>Ad<wbr>Saved</code> and <code>Ad<wbr>Zone<wbr>Saved</code>. It comes with both admins, Filament and Nova.</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$ad </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> app</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">AdWriter</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">    'name'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Spring sale'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">    'kind'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'image'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">    'weight'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 3</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">    'settings'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'attachment_id'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 12</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'url'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'https://example.com/sale'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">],</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], $user);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$zone </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> app</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">ZoneWriter</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'name'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'After the intro'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'placement'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'after_paragraph'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'paragraph'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], $user);</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">app</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">ZoneWriter</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">setAds</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($zone, [$ad</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">id], $user);</span></span></code></pre>
</div><p>With kitloom/security's Content Security Policy, the module names the hosts of the networks that are running. Google says the hosts its ad code uses change and supports only a strict, nonce-based policy for AdSense, so try a site with ads on the report-only header first.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/ads/filament/zones.jpg" src="https://media.kitloom.dev/lessons/ads/filament/zones.mp4"></video>
  <figcaption>Banners that take turns in a zone</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/ads/filament/adsense.jpg" src="https://media.kitloom.dev/lessons/ads/filament/adsense.mp4"></video>
  <figcaption>AdSense, ads.txt and who sees no ads</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/ads/filament/feed.jpg" src="https://media.kitloom.dev/lessons/ads/filament/feed.mp4"></video>
  <figcaption>A product feed for Google Merchant Center</figcaption>
</figure>
</div>
<h2 id="install-it" tabindex="-1">Install it <a class="header-anchor" href="#install-it" aria-label="Permalink to &quot;Install it&quot;">&ZeroWidthSpace;</a></h2>
<p>The module comes with kitloom, for either admin. On a Filament site:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> require</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/ads</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/ads-filament</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> migrate</span></span></code></pre>
</div><p>On a Nova site, the second package is <code>kitloom/<wbr>ads-<wbr>nova</code>. Every detail of the module is in the <a href="https://kitloom.dev/docs/modules/guides/ads.html">Ads guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Content Security Policy in Laravel, without breaking the site</title>
      <link>https://kitloom.dev/blog/content-security-policy-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/content-security-policy-in-laravel.html</guid>
      <pubDate>Fri, 30 Oct 2026 12:00:00 GMT</pubDate>
      <description>CSP and security headers for a Laravel site: report-only first, a screen of what browsers report, Allow for what the site needs, then enforce. With HSTS, a sign-in journal and locks on addresses that guess passwords.</description>
      <content:encoded><![CDATA[<p>A plugin has a hole, or a password leaks, and a line of JavaScript ends up in your checkout page. It reads what customers type and sends it to another host. Nothing on the server looks wrong, and the shop goes on selling.</p>
<p>A Content Security Policy stops exactly this. It is a header that tells the browser what a page may load and run, and a script the policy does not allow simply does not run. Everyone agrees it is a good idea, and few sites have one, because writing it by hand is the kind of job that breaks a site on a Friday: every tracker has its hosts, inline scripts need a nonce, and a page cache keeps yesterday's nonce.</p>
<p>kitloom/security takes it in three steps, and shows you what each one would do before it does it. Beside the policy it brings the other security headers, a journal of sign-ins, and locks on addresses that guess passwords.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user may manage security does this through <code>security_<wbr>report</code>, <code>security_<wbr>csp_<wbr>reports</code>, <code>security_<wbr>csp_<wbr>allow</code>, <code>security_<wbr>settings_<wbr>update</code>, <code>security_<wbr>login_<wbr>attempts</code>, <code>security_<wbr>locks</code>, <code>security_<wbr>lock_<wbr>address</code> and <code>security_<wbr>unlock_<wbr>address</code>:</p>
<ul>
<li><em>&quot;How does the site's security stand?&quot;</em></li>
<li><em>&quot;Who has been guessing passwords this week? Lock that network.&quot;</em></li>
<li><em>&quot;Go through the policy's reports and tell me what the site really needs.&quot;</em></li>
<li><em>&quot;My office got locked out. Let 203.0.113.5 back in.&quot;</em></li>
</ul>
<p>An agent is told the policy's way before it starts: report first, allow what the site uses, then enforce. It asks you before enforcing and before HSTS, and asks about any host it cannot tie to something the site uses. Anyone can send a report, so its text is data to the agent, never instructions. The key's user decides what it may do at all. How to connect one: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="from-report-only-to-enforce" tabindex="-1">From report-only to enforce <a class="header-anchor" href="#from-report-only-to-enforce" aria-label="Permalink to &quot;From report-only to enforce&quot;">&ZeroWidthSpace;</a></h2>
<p>On <strong>Security → Settings</strong> the policy starts <strong>Off</strong>, and a page stays exactly as it was: no header, not one changed byte of its markup.</p>
<p><strong>Report only.</strong> Nothing is stopped. Browsers tell the site what the policy would have stopped, and <strong>Security → Policy Reports</strong> lists it: what, under which directive, on which page, how many times. Use the site for a week, and go through your checkout, sign-in and forms yourself.</p>
<p><strong>Allow.</strong> A report of a host you recognise has a button: <strong>Allow</strong> puts the host on the policy's list and clears the reports it answers. A host you do not recognise may be just what the policy is for. Code written into a page (<code>inline</code>, <code>eval</code>) has no host to allow, and the report says which page to look at.</p>
<p><strong>Enforce.</strong> Once no new reports come in. A script from any other host, or one written into a post, no longer runs, and the same screen tells you when it happens. Browser extensions report too; those are dropped before they reach the list.</p>
<h3 id="what-is-already-allowed" tabindex="-1">What is already allowed <a class="header-anchor" href="#what-is-already-allowed" aria-label="Permalink to &quot;What is already allowed&quot;">&ZeroWidthSpace;</a></h3>
<table tabindex="0">
<thead>
<tr>
<th>What</th>
<th>How</th>
</tr>
</thead>
<tbody>
<tr>
<td>The site's own files, and the host of <code>ASSET_<wbr>URL</code></td>
<td>Always</td>
</tr>
<tr>
<td>Pictures and video from anywhere</td>
<td>Posts link them from everywhere, and they run nothing</td>
</tr>
<tr>
<td>Inline styles</td>
<td>The block editor's markup and a server-drawn page are full of them</td>
</tr>
<tr>
<td>Frames from YouTube, Vimeo, X, Instagram, TikTok, Facebook, Spotify, SoundCloud and Google Maps</td>
<td>A list in the configuration</td>
</tr>
<tr>
<td>The counters of Analytics, the pixels of Ad Pixels, Tag Manager's container, Sentry, the captcha of Forms, a theme's fonts</td>
<td>Each module names its hosts, <strong>only for what is switched on</strong></td>
</tr>
</tbody>
</table>
<p>That last line is what makes the job short. A site with Plausible on is not opened to Google, and a site that chose hCaptcha is not opened to Cloudflare. Your own snippets in Header &amp; Footer get the page's nonce, and what they load shows up in the reports.</p>
<p>The admin goes without a policy: Filament and Nova need code a nonce does not reach. The other headers go out there too.</p>
<h2 id="the-other-headers" tabindex="-1">The other headers <a class="header-anchor" href="#the-other-headers" aria-label="Permalink to &quot;The other headers&quot;">&ZeroWidthSpace;</a></h2>
<p>Installing the module sends what cannot break a site, and <strong>What an answer carries now</strong> at the top of the settings page shows the result.</p>
<table tabindex="0">
<thead>
<tr>
<th>Header</th>
<th>From the start</th>
<th>What it does</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>X-<wbr>Content-<wbr>Type-<wbr>Options</code></td>
<td><code>nosniff</code></td>
<td>An upload cannot pass for a script</td>
</tr>
<tr>
<td><code>X-<wbr>Frame-<wbr>Options</code></td>
<td><code>SAMEORIGIN</code></td>
<td>Another site cannot show yours in a frame to trick a visitor into clicking</td>
</tr>
<tr>
<td><code>Permissions-<wbr>Policy</code></td>
<td>Camera, microphone and location closed</td>
<td>A script that got in cannot ask for them</td>
</tr>
<tr>
<td><code>Strict-<wbr>Transport-<wbr>Security</code></td>
<td>Off</td>
<td>Browsers keep to HTTPS</td>
</tr>
<tr>
<td><code>Cross-<wbr>Origin-<wbr>Opener-<wbr>Policy</code></td>
<td>Off</td>
<td>A window the site opened cannot reach back into it</td>
</tr>
</tbody>
</table>
<p>HSTS starts off for a good reason: a browser that has seen it refuses plain HTTP until the time runs out, and nothing on the server takes that back. Start at 7 days, and raise it once nothing has gone wrong. If the page says the header was held back though the site is on HTTPS, a proxy in front of it is not trusted yet.</p>
<h2 id="who-is-guessing-passwords" tabindex="-1">Who is guessing passwords <a class="header-anchor" href="#who-is-guessing-passwords" aria-label="Permalink to &quot;Who is guessing passwords&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Security → Sign-in Attempts</strong> lists every try on the site's form and the admin's: when, how it ended, with which login, from which address. Never a password.</p>
<p>The login forms already slow down guessing at one login from one address. What they cannot see is one address guessing across many logins, which is what guessing looks like. So five wrong passwords in 15 minutes lock an address for 20 minutes on every form, and an address locked four times in a day waits a whole day. All of those numbers are settings. A locked address hears the same whether its password was right or not, so a lock tells a guesser nothing.</p>
<p><strong>Security → Locked Addresses</strong> shows what is in force, lifts a lock, and locks an address or a whole network by hand. <strong>Never lock</strong> is for your office. If you ever lock yourself out:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> security:unlock</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 203.0.113.5</span></span></code></pre>
</div><p>A lock is news: it reaches you in <a href="https://kitloom.dev/blog/telegram-notifications-in-laravel.html">Telegram, Slack or by email</a> with the address and the logins it tried. Attempts are kept 30 days and go through Export and Erase Personal Data, since a login may be someone's email.</p>
<p>Two things stay as they were. The REST API's application passwords keep their own limit and are not in the journal, and the two-factor step keeps its own limit per user.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>It is <a href="https://github.com/spatie/laravel-csp" target="_blank" rel="noreferrer">spatie/laravel-csp</a>'s <code>Policy</code>, with the parts a CMS needs around it.</p>
<p>A module says what it loads with a <code>Spatie\<wbr>Csp\<wbr>Preset</code> tagged <code>Csp<wbr>Presets::<wbr>TAG</code>, behind <code>class_<wbr>exists()</code>, so neither package requires the other. Spatie's own presets serve where they fit. The module's Analytics does not use the Google Analytics one, which allows scripts from all of <code>*.<wbr>google.<wbr>com</code>, a host that serves JSONP.</p>
<p>The nonce is Vite's, the one Livewire, Filament and every module already put on their scripts. It is set per request only while a policy is on, so a worker under Octane never hands one visitor's nonce to the next.</p>
<p>The awkward part is the page cache, which keeps a page and sends it again without starting the application. A global middleware would put a fresh nonce on a page drawn with an old one and stop every script on it. So the header goes on in <code>Response<wbr>Prepared</code>, inside the route, before the cache looks: a kept page goes out with the nonce its markup has, and saving an option draws the kept pages anew. A failed read of the options answers with the defaults, so a header never takes down an error page.</p>
<p><code>style-<wbr>src</code> keeps <code>'unsafe-<wbr>inline'</code> on purpose. Everything lives in <code>security_<wbr>*</code> options, written through <code>Setting<wbr>Writer</code> behind the <code>manage_<wbr>security</code> permission, and each value is checked again when the header is made, so a row edited by hand never reaches a header.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/security/filament/content-security-policy.jpg" src="https://media.kitloom.dev/lessons/security/filament/content-security-policy.mp4"></video>
  <figcaption>Content Security Policy, from report-only to enforce</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/security/filament/headers.jpg" src="https://media.kitloom.dev/lessons/security/filament/headers.mp4"></video>
  <figcaption>Security headers: HSTS and X-Frame-Options</figcaption>
</figure>
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/security/filament/sign-ins.jpg" src="https://media.kitloom.dev/lessons/security/filament/sign-ins.mp4"></video>
  <figcaption>Sign-in attempts: lock the addresses that guess passwords</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail of the module is in the <a href="https://kitloom.dev/docs/modules/guides/security.html">Security guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>kitloom vs Pollora: WordPress inside Laravel, or a site that moves to Laravel</title>
      <link>https://kitloom.dev/blog/kitloom-vs-pollora.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/kitloom-vs-pollora.html</guid>
      <pubDate>Fri, 30 Oct 2026 12:00:00 GMT</pubDate>
      <description>Pollora runs WordPress inside a Laravel app, keeping wp-admin and every plugin. kitloom keeps the WordPress database and runs no WordPress code, with an admin in Filament or Nova and an AI agent that runs the site.</description>
      <content:encoded><![CDATA[<p>Search for Laravel and WordPress together and you will find Pollora and kitloom side by side. Both are installed with Composer into a Laravel 13 application, both read the WordPress database, and both draw the site with Laravel. They take opposite roads, though. Pollora keeps WordPress running inside Laravel, with its admin and its plugins. kitloom keeps WordPress's data and runs none of its code. Here is where each road leads, and which one fits your site.</p>
<h2 id="what-each-one-is" tabindex="-1">What each one is <a class="header-anchor" href="#what-each-one-is" aria-label="Permalink to &quot;What each one is&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Pollora</strong> is a framework where a Laravel application runs WordPress. Composer installs WordPress core into <code>public/<wbr>cms</code>, and Pollora loads it while Laravel boots, with Laravel's configuration and database connection. On each request WordPress starts with its active plugins and resolves the query, so its conditional tags work. The response is drawn by Laravel: your own routes first, then <code>Route::<wbr>wp()</code> routes that match conditional tags (<code>single</code>, <code>archive</code>, <code>/</code>), then the template hierarchy rendered with Blade. The admin is WordPress's own at <code>/<wbr>cms/<wbr>wp-<wbr>admin/</code>, with Gutenberg and the Site Editor. Post types, taxonomies, hooks, REST routes, typed meta and roles are declared with PHP 8 attributes (<code>#[Post<wbr>Type]</code>, <code>#[Action]</code>, <code>#[Filter]</code>, <code>#[Meta]</code>) and found by auto-discovery. Media can live on any Laravel disk, S3 or R2 included. WordPress's models come from Colt, Pollora's fork of Corcel. It is MIT-licensed and free, and its version numbers follow Laravel's: v13.39 in October 2026.</p>
<p><strong>kitloom</strong> is a Laravel CMS whose storage is the WordPress database. Point it at one and the same site answers at the same URLs, with the same users and their passwords, and with the plugins' data read in the plugins' own formats. There is no WordPress code inside: the request is handled the way WordPress handles it (permalinks, the main query, the template hierarchy), but by Laravel code. The models speak Laravel (<code>$post-<wbr>&gt;title</code>, <code>$post-<wbr>&gt;field('price')</code>, <code>Settings::<wbr>get()</code>). On top of that it brings:</p>
<ul>
<li>an admin in Filament 5 or Laravel Nova 5;</li>
<li>more than 40 modules, among them a shop, bookings, courses, listings, languages, SEO, redirects and forms;</li>
<li>14 themes in Blade, Vue or React;</li>
<li>an MCP server, so an AI agent can run the site with the rights you give it.</li>
</ul>
<h2 id="side-by-side" tabindex="-1">Side by side <a class="header-anchor" href="#side-by-side" aria-label="Permalink to &quot;Side by side&quot;">&ZeroWidthSpace;</a></h2>
<table tabindex="0">
<thead>
<tr>
<th></th>
<th>Pollora</th>
<th>kitloom</th>
</tr>
</thead>
<tbody>
<tr>
<td>What it is</td>
<td>A Laravel framework that runs WordPress</td>
<td>A Laravel CMS on WordPress's data model</td>
</tr>
<tr>
<td>WordPress code at run time</td>
<td>Core and every active plugin, on each request</td>
<td>None</td>
</tr>
<tr>
<td>Admin</td>
<td>WordPress's own (<code>/<wbr>cms/<wbr>wp-<wbr>admin/</code>)</td>
<td>Filament 5 or Laravel Nova 5, with the same modules in each</td>
</tr>
<tr>
<td>Editing</td>
<td>Gutenberg and the Site Editor; block themes work</td>
<td>A visual editor; existing Gutenberg blocks are drawn, there is no block editor for new content</td>
</tr>
<tr>
<td>WordPress plugins</td>
<td>They keep running as plugins; WooCommerce gets Blade templates from <code>pollora/<wbr>woocommerce</code></td>
<td>They do not run; modules read their data and take over their behaviour: ACF, Contact Form 7 and Flamingo, WooCommerce, Rank Math, LearnPress and others, with Yoast SEO and Redirection brought over by a command</td>
</tr>
<tr>
<td>Your own code</td>
<td>WordPress hooks, post types and REST routes declared with attributes; Laravel routes and controllers beside them</td>
<td>Laravel all the way: Eloquent models, contracts, container tags and Laravel events (<code>Post<wbr>Saved</code>, <code>Post<wbr>Published</code>); no hooks</td>
</tr>
<tr>
<td>Front end</td>
<td>Blade with Sage Directives, Vite, Gutenberg blocks rendered with Blade</td>
<td>Blade, Vue or React themes; every page as JSON, and the <code>wp/<wbr>v2</code> REST API</td>
</tr>
<tr>
<td>Speed, 13 typical pages, no page cache</td>
<td>33.8 ms, 1.72× the same WordPress alone (19.6 ms in that run)</td>
<td>18.3 ms with what a bare WordPress has (0.86×), 32.8 ms with every module and the admin (1.53×), against 21.4 ms for WordPress in that run</td>
</tr>
<tr>
<td>Updates</td>
<td>WordPress core and plugins through Composer</td>
<td>kitloom packages through Composer; no WordPress to update</td>
</tr>
<tr>
<td>AI agents</td>
<td>Nectar, on Laravel Boost, gives the agent that writes your code guidelines, skills and MCP tools that read the environment; the separate MCP Connector plugin lets a client manage posts, media and menus over OAuth</td>
<td>Built in (<code>kitloom/<wbr>ai</code>): an agent connects to <code>/<wbr>mcp</code> and works on content, media, settings and every installed module, with the rights of the key's user; locked settings, nothing deleted for good, every change in the activity log</td>
</tr>
<tr>
<td>Requirements</td>
<td>PHP 8.4 for a new project, Laravel 13, WordPress 7.1, MySQL or MariaDB</td>
<td>PHP 8.4, Laravel 13, a database: SQLite, MySQL or MariaDB</td>
</tr>
<tr>
<td>Price</td>
<td>MIT, free</td>
<td>$299 for one site, with a year of every update and new module; after it the modules you have keep their updates free and only later modules need a renewal; one admin per license, Filament or Nova</td>
</tr>
<tr>
<td>Age</td>
<td>Since October 2024, a small team, about 9,000 installs</td>
<td>Version 1 in October 2026, a small community</td>
</tr>
</tbody>
</table>
<h2 id="when-pollora-is-the-better-choice" tabindex="-1">When Pollora is the better choice <a class="header-anchor" href="#when-pollora-is-the-better-choice" aria-label="Permalink to &quot;When Pollora is the better choice&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>A plugin you depend on has no kitloom module.</strong> WPML, Gravity Forms, a membership plugin, a page builder: under Pollora they keep running as they are, because WordPress is still there. kitloom reads the data of the plugins it has modules for and nothing else.</li>
<li><strong>Your editors live in Gutenberg.</strong> The block editor, patterns and the Site Editor stay exactly as they are. kitloom draws the blocks a site already has, but new content is written in a visual editor, not in blocks.</li>
<li><strong>You want to keep WordPress and write the code the Laravel way.</strong> Pollora's attributes and auto-discovery make post types, hooks and REST routes tidy PHP classes instead of a long <code>functions.<wbr>php</code>, and Laravel's routing, Blade and testing come with them. If leaving WordPress is not the goal, that is a lot of comfort for nothing.</li>
<li><strong>It must be free.</strong> Pollora is MIT. kitloom has no free edition: you see everything in the demos first, and there is a 14-day refund.</li>
</ul>
<h2 id="when-kitloom-is" tabindex="-1">When kitloom is <a class="header-anchor" href="#when-kitloom-is" aria-label="Permalink to &quot;When kitloom is&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>An AI agent runs the site, under your control.</strong> kitloom ships an MCP server for the agent that does the site's work, not only the one that writes its code. Claude, Cursor or your own agent connects to <code>/<wbr>mcp</code>, calls <code>describe_<wbr>site</code> first, then works through the same code as the admin: <code>create_<wbr>content</code> and <code>update_<wbr>content</code> for posts and pages, <code>upload_<wbr>media</code>, <code>menu_<wbr>save</code>, <code>product_<wbr>save</code> and <code>orders_<wbr>list</code>, and the tools of SEO, redirects, forms, bookings, courses and translations. Ask it to &quot;find the 404s from last week and redirect them to the closest page&quot;, or to &quot;fill in the SEO descriptions of the products that have none&quot;. It acts as the user whose key it holds: an author's key writes drafts, a read-only key only reads. The settings that decide who gets in or what code runs on every page are locked, <code>trash_<wbr>content</code> is the only way out of a record and <code>restore_<wbr>content</code> brings it back, every change goes into the activity log, and revoking the key stops it at once. See <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</li>
<li><strong>You want the site to be a Laravel application, not a WordPress one in a Laravel frame.</strong> With kitloom there is one framework at run time: one boot, one set of events, Eloquent and Laravel's queues and cache all the way down, and nothing of WordPress's PHP or its plugins' to patch. Under Pollora both frameworks start on each request, and it shows: on <a href="https://kitloom.dev/blog/wordpress-vs-kitloom-benchmarks.html">our benchmark</a>'s database, with the same Twenty Twenty-One theme as the bare WordPress, Pollora answers thirteen typical pages in 33.8 ms against WordPress's 19.6 ms and serves 0.6 times as many pages a second. In a later run on the same machine WordPress took 21.4 ms, and kitloom took 18.3 ms with what a bare WordPress has, serving 1.14 times as many pages a second, and 32.8 ms as the whole skeleton with every module and the admin, serving 0.66 times as many.</li>
<li><strong>Your team works in Filament or Nova.</strong> The admin is the one they know, and a module's screens are ordinary Filament or Nova resources they can extend. With Pollora the admin stays wp-admin, and whatever you add to it is written the WordPress way.</li>
<li><strong>The site sells, books or teaches.</strong> The shop, bookings, courses and listings are modules of the same product, tested together, with admins in Filament and Nova. Under Pollora each is a WordPress plugin with its own data model and its own updates.</li>
<li><strong>The site is on WordPress now, and you want it to leave.</strong> Every URL keeps working, users keep their passwords, and the plugins' data keeps working, not just reads: a Contact Form 7 form still sends, WooCommerce orders can still be refunded, Rank Math's redirects still redirect. You can rehearse the move on the live database first. See <a href="https://kitloom.dev/blog/migrate-wordpress-to-laravel.html">Migrate WordPress to Laravel without moving the content</a>.</li>
</ul>
<h2 id="try-both" tabindex="-1">Try both <a class="header-anchor" href="#try-both" aria-label="Permalink to &quot;Try both&quot;">&ZeroWidthSpace;</a></h2>
<p>Pollora is free: <code>composer create-<wbr>project pollora/<wbr>pollora my-<wbr>site</code> and the setup asks for the database. Its documentation is at <a href="https://pollora.dev" target="_blank" rel="noreferrer">pollora.dev</a>.</p>
<p>For kitloom, open a sandbox in one click, no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament demo</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova demo</a>. Connect an agent to it from the dashboard and give it something to do. Then follow <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a> on your own data, starting read-only. Prices and the refund are on <a href="https://kitloom.dev/pricing.html">Pricing</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Laravel Filament plugins for a full website: what to install</title>
      <link>https://kitloom.dev/blog/laravel-filament-plugins-for-a-website.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/laravel-filament-plugins-for-a-website.html</guid>
      <pubDate>Fri, 30 Oct 2026 12:00:00 GMT</pubDate>
      <description>Which Laravel Filament plugins a public website needs: pages, menus, SEO, redirects, forms, media, roles and backups, what they leave to you, and when a CMS fits better.</description>
      <content:encoded><![CDATA[<p>Filament gives you an excellent admin panel, but a public website needs more than a panel: pages, menus, SEO, redirects, forms, a media library, roles and backups. <a href="https://filamentphp.com/plugins" target="_blank" rel="noreferrer">Filament's plugin directory</a> lists more than 1,200 plugins, so most of these jobs have an answer. The harder questions are which plugins to pick and what is still left for you to build.</p>
<p>Here is a short list for each job, then what plugins leave open, and when a CMS is the better choice.</p>
<h2 id="the-plugins-job-by-job" tabindex="-1">The plugins, job by job <a class="header-anchor" href="#the-plugins-job-by-job" aria-label="Permalink to &quot;The plugins, job by job&quot;">&ZeroWidthSpace;</a></h2>
<p>All of these list Filament 5 support on their directory pages as of October 2026. Check each package's <code>composer.<wbr>json</code> before you rely on it, as version lists can lag behind the code.</p>
<table tabindex="0">
<thead>
<tr>
<th>Job</th>
<th>Plugin</th>
<th>What it does</th>
</tr>
</thead>
<tbody>
<tr>
<td>A CMS in one package</td>
<td><a href="https://filamentphp.com/plugins/tallcms-core" target="_blank" rel="noreferrer">TallCMS Core</a> (<code>tallcms/<wbr>cms</code>)</td>
<td>Pages and posts, menus, a media library, SEO tools and a block editor. MIT</td>
</tr>
<tr>
<td>Pages with SEO and redirects</td>
<td><a href="https://filamentphp.com/plugins/statik-flexible-content-block-pages" target="_blank" rel="noreferrer">Flexible Content Block Pages</a> (<code>statikbe/<wbr>laravel-<wbr>filament-<wbr>flexible-<wbr>content-<wbr>block-<wbr>pages</code>)</td>
<td>Block-based pages, a menu builder, SEO fields, redirects, a sitemap and multilingual URLs. MIT</td>
</tr>
<tr>
<td>Menus</td>
<td><a href="https://filamentphp.com/plugins/datlechin-menu-builder" target="_blank" rel="noreferrer">Menu Builder</a> (<code>datlechin/<wbr>filament-<wbr>menu-<wbr>builder</code>)</td>
<td>Nested menus that you render anywhere in the application. MIT</td>
</tr>
<tr>
<td>Media</td>
<td><a href="https://filamentphp.com/plugins/awcodes-curator" target="_blank" rel="noreferrer">Curator</a> (<code>awcodes/<wbr>filament-<wbr>curator</code>)</td>
<td>A media picker and manager with image transformations. MIT</td>
</tr>
<tr>
<td>Forms</td>
<td><a href="https://filamentphp.com/plugins/lara-zeus-bolt" target="_blank" rel="noreferrer">Bolt</a> (Lara Zeus)</td>
<td>A form builder for your users, with a separate paid Pro edition</td>
</tr>
<tr>
<td>Roles and permissions</td>
<td><a href="https://filamentphp.com/plugins/bezhansalleh-shield" target="_blank" rel="noreferrer">Shield</a> (<code>bezhansalleh/<wbr>filament-<wbr>shield</code>)</td>
<td>Policies and permissions for your panels. MIT</td>
</tr>
<tr>
<td>Activity log</td>
<td><a href="https://filamentphp.com/plugins/rmsramos-activitylog" target="_blank" rel="noreferrer">Activity Log</a> (<code>rmsramos/<wbr>activitylog</code>)</td>
<td>Screens over Spatie's <code>laravel-<wbr>activitylog</code>. MIT</td>
</tr>
<tr>
<td>Backups</td>
<td><a href="https://filamentphp.com/plugins/shuvroroy-spatie-laravel-backup" target="_blank" rel="noreferrer">Spatie Laravel Backup</a> (<code>shuvroroy/<wbr>filament-<wbr>spatie-<wbr>laravel-<wbr>backup</code>)</td>
<td>Create, monitor, download and delete backups. MIT</td>
</tr>
</tbody>
</table>
<p>For a small site, one of the first two rows and a backup plugin may be all you need. Look at them first, because each plugin you add later is one more thing to keep up to date.</p>
<h2 id="what-to-check-before-you-stack-them" tabindex="-1">What to check before you stack them <a class="header-anchor" href="#what-to-check-before-you-stack-them" aria-label="Permalink to &quot;What to check before you stack them&quot;">&ZeroWidthSpace;</a></h2>
<p>Each plugin can be good on its own. These questions are about what happens when you combine several:</p>
<ul>
<li><strong>The next Filament upgrade.</strong> Your panel can only move to a new major version once every plugin you depend on has moved too.</li>
<li><strong>Security.</strong> The directory itself warns that, apart from official plugins, &quot;the security of all others is not reviewed or vetted&quot;. Read the code of what you install on a public site.</li>
<li><strong>Who draws the public pages.</strong> An admin plugin gives you a screen and a table. Check what it gives the front end: routes, templates, canonical URLs, search, a page cache. Whatever it leaves out is your code to write and maintain.</li>
<li><strong>Roles across plugins.</strong> Check that every plugin's screens respect the roles you set up, and that an editor can't reach settings meant for an administrator.</li>
<li><strong>Who does the daily work.</strong> Plugins give a person a screen. If an AI agent is going to run the site, it needs tools for each of those jobs, with limits on what it may do.</li>
</ul>
<h2 id="when-plugins-are-the-right-choice" tabindex="-1">When plugins are the right choice <a class="header-anchor" href="#when-plugins-are-the-right-choice" aria-label="Permalink to &quot;When plugins are the right choice&quot;">&ZeroWidthSpace;</a></h2>
<p>Stay with plugins when:</p>
<ul>
<li><strong>The site is a small part of a larger application.</strong> Your Laravel app has a Filament panel and needs a few pages and a menu. A CMS would be far more than you need.</li>
<li><strong>You need it free.</strong> Everything in the table has a free edition. kitloom does not.</li>
<li><strong>You want your own data model.</strong> Plugins let you shape your tables. kitloom's content is stored in the WordPress data model.</li>
</ul>
<h2 id="when-the-site-is-the-product-kitloom" tabindex="-1">When the site is the product: kitloom <a class="header-anchor" href="#when-the-site-is-the-product-kitloom" aria-label="Permalink to &quot;When the site is the product: kitloom&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom is a Laravel CMS with Filament or Nova as its admin, and an AI agent can run the site under your control. It isn't a plugin you add to an existing panel. Its modules need kitloom's core and data model, and it is sold whole: <a href="https://kitloom.dev/services.html#license">$299 for one site</a>.</p>
<p>In exchange, these jobs come as modules of one product, released and tested together: <a href="https://kitloom.dev/docs/modules/guides/seo.html">SEO</a>, <a href="https://kitloom.dev/docs/modules/guides/redirects.html">Redirections</a>, <a href="https://kitloom.dev/docs/modules/guides/forms.html">Forms</a>, <a href="https://kitloom.dev/docs/modules/guides/backup.html">Backup</a>, <a href="https://kitloom.dev/docs/modules/guides/activity-log.html">Activity Log</a>, the <a href="https://kitloom.dev/docs/modules/guides/shop.html">shop</a>, <a href="https://kitloom.dev/docs/modules/guides/bookings.html">bookings</a> and more. There are also themes in Blade, Vue or React for the public pages.</p>
<p>A module's screens are ordinary Filament resources and pages. Installing the package is enough, because its service provider adds the plugin to the panel, and a config switch turns it off:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Panel</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">configureUsing</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Panel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $panel)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> config</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'kitloom-redirects.filament.register'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    $panel</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">plugin</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">RedirectsPlugin</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">make</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">());</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">});</span></span></code></pre>
</div><p>No WordPress is installed and none of its code runs. kitloom only takes the shape of its data, so a WordPress site can also move in with its content, URLs and users.</p>
<h2 id="an-ai-agent-runs-the-site-under-your-control" tabindex="-1">An AI agent runs the site, under your control <a class="header-anchor" href="#an-ai-agent-runs-the-site-under-your-control" aria-label="Permalink to &quot;An AI agent runs the site, under your control&quot;">&ZeroWidthSpace;</a></h2>
<p>Each kitloom module brings tools for agents as well as screens for people. Claude, Cursor or your own agent connects to <code>/<wbr>mcp</code>, calls <code>describe_<wbr>site</code>, and works through the same code as the admin: <code>create_<wbr>content</code>, <code>upload_<wbr>media</code>, <code>menu_<wbr>save</code>, <code>seo_<wbr>update</code>, <code>form_<wbr>create</code>, <code>redirect_<wbr>from_<wbr>404</code>.</p>
<p>You can ask it to &quot;draft three posts from these notes and put them in the Guides category&quot;, or &quot;which addresses gave 404 this week? Redirect the ones that have a new page&quot;.</p>
<p>It acts as the user whose key it holds, so an author's key writes drafts and a read-only key only reads. The settings that decide who gets in or what code runs on every page are locked. Nothing is deleted for good, every change is in the activity log, and revoking the key stops it at once. See <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament sandbox</a> in one click, with no sign-up, and every module and theme is there. Look through the screens, then connect an agent from the dashboard and give it something to do. There is no free edition, but you get a 14-day refund: see <a href="https://kitloom.dev/pricing.html">Pricing</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>php artisan top — real-time monitoring of a Laravel site, page by page</title>
      <link>https://kitloom.dev/blog/php-artisan-top-real-time-monitoring-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/php-artisan-top-real-time-monitoring-laravel.html</guid>
      <pubDate>Fri, 30 Oct 2026 12:00:00 GMT</pubDate>
      <description>Laravel Top in a kitloom site: requests, queries and cache per second and the busiest pages, live in the terminal or the admin — with the site's pages named by their template, and an AI agent reading the load.</description>
      <content:encoded><![CDATA[<p>A campaign email went out ten minutes ago. Is the site holding up? Pulse will tell you in an hour, in averages. Telescope will tell you tomorrow which request was slow. Right now, you want what <code>top</code> gives a server administrator: a screen that refreshes every second and says what is going on <em>at this moment</em>.</p>
<p><a href="https://github.com/leventcz/laravel-top" target="_blank" rel="noreferrer">Laravel Top</a> is that screen for a Laravel application. <code>php artisan top</code> shows requests per second with their average duration and memory, database queries per second, cache hits and misses, and the twenty busiest routes, averaged over the last five seconds and refreshed as you watch. Its counters live in Redis for a few seconds, so the figures come from every server of the site at once.</p>
<p>On a CMS it has one blind spot. Every page of the site goes through one route, so the &quot;busiest routes&quot; table is one line long: the whole site. kitloom/top brings Top in and fixes that, and a few other things a live site needs.</p>
<h2 id="the-pages-by-template" tabindex="-1">The pages, by template <a class="header-anchor" href="#the-pages-by-template" aria-label="Permalink to &quot;The pages, by template&quot;">&ZeroWidthSpace;</a></h2>
<p>A request of a page is listed under the template it was drawn with, the way the template hierarchy names it and the way Pulse already names the slow pages:</p>
<table tabindex="0">
<thead>
<tr>
<th>On the screen</th>
<th>The page</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>front-<wbr>page</code></td>
<td>The home page</td>
</tr>
<tr>
<td><code>single-<wbr>product</code>, <code>single-<wbr>post</code>, <code>single-<wbr>book</code></td>
<td>One record of the type</td>
</tr>
<tr>
<td><code>taxonomy-<wbr>product_<wbr>cat</code>, <code>category</code>, <code>tag</code></td>
<td>A term's archive</td>
</tr>
<tr>
<td><code>search</code></td>
<td>The search results</td>
</tr>
<tr>
<td><code>404</code></td>
<td>Nothing found</td>
</tr>
<tr>
<td><code>cached page</code></td>
<td>A page the page cache answered: no template was resolved</td>
</tr>
</tbody>
</table>
<p>The admin's screens and the site's own endpoints keep Top's own name, their route: <code>/<wbr>admin/<wbr>posts/<wbr>{record}/<wbr>edit</code>, <code>/<wbr>livewire/<wbr>update</code>, <code>/<wbr>wp-<wbr>json/<wbr>…</code>. So during that campaign you see that the product pages take 160 ms and the search 190, that the category archive is the one eating the database, and that <code>404</code> has a surprising number of requests per second — someone linked the wrong address.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user may watch the site calls <code>top_<wbr>snapshot</code>:</p>
<ul>
<li><em>&quot;Is the site under load right now?&quot;</em></li>
<li><em>&quot;Which pages are the busiest at this moment, and how slow are they?&quot;</em></li>
<li><em>&quot;Is the cache being hit, or is everything missing?&quot;</em></li>
</ul>
<p>The tool turns recording on, waits the five seconds Top averages over, and answers with the same figures and the same page names. Top records only while someone watches, so the reading costs the site five seconds of counting and nothing before or after. The agent then opens Pulse for the history, or the <a href="https://kitloom.dev/blog/why-is-this-page-slow-laravel.html">page inspector</a> for the one page that stands out. How to connect one: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="in-the-admin-and-without-redis" tabindex="-1">In the admin, and without Redis <a class="header-anchor" href="#in-the-admin-and-without-redis" aria-label="Permalink to &quot;In the admin, and without Redis&quot;">&ZeroWidthSpace;</a></h2>
<p>The <strong>Top</strong> section of the Filament admin has a <strong>Live</strong> screen: the same boxes and the same table, refreshed every two seconds while it is open, for whoever has no terminal at hand. In Nova the section says where things stand; the live screen there is the terminal.</p>
<p>The section's badge says what the site can do: <strong>ready</strong> when Redis answers, <strong>watching</strong> while someone runs <code>php artisan top</code> or has the Live screen open, <strong>no Redis client</strong> or <strong>Redis is down</strong> when it cannot record. Top alone would make every request fail on the one Redis call it makes to learn whether <code>top</code> is running; here a site without Redis serves as before, and the badge, the terminal and the agent say in words what is missing and what to set.</p>
<h2 id="top-pulse-telescope-the-inspector" tabindex="-1">Top, Pulse, Telescope, the inspector <a class="header-anchor" href="#top-pulse-telescope-the-inspector" aria-label="Permalink to &quot;Top, Pulse, Telescope, the inspector&quot;">&ZeroWidthSpace;</a></h2>
<table tabindex="0">
<thead>
<tr>
<th>Tool</th>
<th>Shows</th>
<th>For</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Top</strong></td>
<td>The last five seconds, live</td>
<td>What the site is doing right now</td>
</tr>
<tr>
<td><a href="https://kitloom.dev/docs/modules/guides/pulse.html">Pulse</a></td>
<td>Totals and averages over hours and days</td>
<td>How the site does in general</td>
</tr>
<tr>
<td><a href="https://kitloom.dev/docs/modules/guides/telescope.html">Telescope</a></td>
<td>Each recorded request, query and job, one by one</td>
<td>Why one thing went wrong</td>
</tr>
<tr>
<td><a href="https://kitloom.dev/blog/why-is-this-page-slow-laravel.html"><code>kitloom:<wbr>inspect</code></a></td>
<td>One page: its queries, what it read, why it is slow</td>
<td>Making one page faster</td>
</tr>
</tbody>
</table>
<p>Top sees HTTP requests only; queue jobs and console commands are not counted.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>It is <code>leventcz/<wbr>laravel-<wbr>top</code> as it is (MIT, PHP 8.2+, Redis, <code>pcntl</code> in the console). The module wraps Top's <code>Repository</code> contract: a request is named before it is saved, the Redis repository is made on first use, and a failure to reach Redis becomes a <code>Top<wbr>Unavailable</code> with words — except where a request is being served, where nothing fails. The name comes from kitloom/site's <code>Main<wbr>Query<wbr>Resolved</code> event, kept per request, Octane included. <code>name_<wbr>pages:<wbr> false</code> in <code>config/<wbr>kitloom-<wbr>top.<wbr>php</code> leaves Top's own names; Top's own <code>config/<wbr>top.<wbr>php</code> keeps the connection and the recording mode. Everything is in the <a href="https://kitloom.dev/docs/modules/guides/top.html">guide</a>.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/top/filament/live.jpg" src="https://media.kitloom.dev/lessons/top/filament/live.mp4"></video>
  <figcaption>Watch the site live with Top: the badge, the Live screen, visitors arriving under their templates</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail of the module is in the <a href="https://kitloom.dev/docs/modules/guides/top.html">Top guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Laravel MCP tools that act with the user's permissions</title>
      <link>https://kitloom.dev/blog/laravel-mcp-tools-user-permissions.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/laravel-mcp-tools-user-permissions.html</guid>
      <pubDate>Thu, 29 Oct 2026 12:00:00 GMT</pubDate>
      <description>Give an AI agent your Laravel app without giving it the keys: laravel/mcp tools behind Sanctum token abilities and your own policies, with refusals the model can read.</description>
      <content:encoded><![CDATA[<p>Connecting an AI agent to a Laravel app is easy now. With <a href="https://github.com/laravel/mcp" target="_blank" rel="noreferrer">laravel/mcp</a> you write a server, a few tools, a route, and Claude, Cursor or ChatGPT can call them. The part that takes thought comes next. Who is the agent acting as?</p>
<p>The easy answer is one admin key in an <code>.<wbr>env</code> file, and then every tool runs as the admin. That works until an author connects an agent to &quot;fix the typos in my posts&quot; and it can edit everyone's posts. It also fails when somebody pastes a read-only key into a client and the client still lists a tool that deletes things.</p>
<p>The better answer is the one Laravel already gives you for every other request: <strong>the agent acts as the user who connected it, with that user's policies</strong>. A token decides what kind of key it is (read only, or read and write), and the policies decide what this user may do with each record. This post builds that with laravel/mcp and Sanctum, and the full example is tested.</p>
<h2 id="the-server-and-the-route" tabindex="-1">The server and the route <a class="header-anchor" href="#the-server-and-the-route" aria-label="Permalink to &quot;The server and the route&quot;">&ZeroWidthSpace;</a></h2>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// app/Mcp/Servers/BlogServer.php</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">namespace</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> App\Mcp\Servers</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\Mcp\Tools\ListPosts</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\Mcp\Tools\UpdatePost</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Laravel\Mcp\Server</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> BlogServer</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> extends</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> Server</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    protected</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $name </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Blog'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    protected</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $version </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> '1.0.0'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    protected</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $instructions </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'You act as the user whose token you hold. Read a post before you change it.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    protected</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $tools </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">        ListPosts</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">        UpdatePost</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    ];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// routes/ai.php</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\Mcp\Servers\BlogServer</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Laravel\Mcp\Facades\Mcp</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Mcp</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">web</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/mcp/blog'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">BlogServer</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    -></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">middleware</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'auth:sanctum'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'throttle:60,1'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span></code></pre>
</div><p>There is no <code>web</code> group here: no session and no CSRF, only a token on every request. A user makes their own token on a profile page, and the abilities decide what kind of key it is:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$readOnly </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $user</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">createToken</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Claude'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'posts:read'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">])</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">plainTextToken;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$readWrite </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $user</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">createToken</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Claude'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'posts:read'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'posts:write'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">])</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">plainTextToken;</span></span></code></pre>
</div><p>The client then connects with that token:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">claude</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> mcp</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> add</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --transport</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> http</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> blog</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> https://example.com/mcp/blog</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --header</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> "Authorization: Bearer &#x3C;token>"</span></span></code></pre>
</div><h2 id="a-tool-that-reads" tabindex="-1">A tool that reads <a class="header-anchor" href="#a-tool-that-reads" aria-label="Permalink to &quot;A tool that reads&quot;">&ZeroWidthSpace;</a></h2>
<p>A reading tool shows what this user may see, not what the database holds. Here that means the published posts plus the user's own drafts:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">namespace</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> App\Mcp\Tools</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\Models\Post</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Illuminate\Contracts\JsonSchema\JsonSchema</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Laravel\Mcp\Request</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Laravel\Mcp\Response</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Laravel\Mcp\Server\Tool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Laravel\Mcp\Server\Tools\Annotations\IsReadOnly</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">#[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">IsReadOnly</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> ListPosts</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> extends</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> Tool</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    protected</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $description </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'List the published posts and your own drafts, newest first.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> schema</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">JsonSchema</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $schema)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            'search'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $schema</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">description</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Words in the title'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">),</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        ];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> handle</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Request</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $request)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Response</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $user </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">user</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $posts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">query</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            -></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">where</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">fn</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($query) => $query</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">where</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'status'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'published'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">orWhere</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'user_id'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, $user</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">id))</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            -></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">when</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'search'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">), </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">fn</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($query, $search) => $query</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">where</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'like'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"%{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$search</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}%"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">))</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            -></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">latest</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            -></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">limit</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">20</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            -></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'id'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'status'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Response</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">json</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($posts);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p><code>$request-<wbr>&gt;user()</code> is the Sanctum user of the HTTP request. <code>#[Is<wbr>Read<wbr>Only]</code> tells the client that the tool changes nothing, and some clients then run it without asking.</p>
<h2 id="a-tool-that-writes" tabindex="-1">A tool that writes <a class="header-anchor" href="#a-tool-that-writes" aria-label="Permalink to &quot;A tool that writes&quot;">&ZeroWidthSpace;</a></h2>
<p>The writing tool does three checks, and each one has a different job:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">namespace</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> App\Mcp\Tools</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\Models\Post</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Illuminate\Contracts\JsonSchema\JsonSchema</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Illuminate\Support\Arr</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Laravel\Mcp\Request</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Laravel\Mcp\Response</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Laravel\Mcp\Server\Tool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Laravel\Mcp\Server\Tools\Annotations\IsIdempotent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">#[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">IsIdempotent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> UpdatePost</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> extends</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> Tool</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    protected</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $description </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Change the title or the body of a post.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> schema</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">JsonSchema</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $schema)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            'id'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $schema</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">integer</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">min</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">required</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(),</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $schema</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(),</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            'body'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $schema</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(),</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        ];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    // 1. A read-only token never sees this tool.</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> shouldRegister</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Request</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $request)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> bool</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">user</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">tokenCan</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'posts:write'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">??</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> handle</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Request</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $request)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Response</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $user </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">user</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">        // 2. The same check again, for code that calls the tool another way.</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $user</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">tokenCan</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'posts:write'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Response</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Your token is read-only.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $data </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">validate</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            'id'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'required'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'integer'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">],</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'sometimes'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'string'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'max:200'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">],</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            'body'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'sometimes'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'string'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">],</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        ]);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $post </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">find</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($data[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'id'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($post </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">===</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Response</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"There is no post {</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$data</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">['id']}."</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">        // 3. The policy: may this user edit this post?</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($user</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">cannot</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'update'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, $post)) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Response</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'You may not edit this post: it belongs to another author.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">update</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Arr</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">only</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($data, [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'body'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Response</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">json</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">only</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'id'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'status'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">));</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p><strong><code>should<wbr>Register()</code></strong> hides the tool from the list. That matters more than it looks: a model plans with the tools it can see, so a read-only agent should never plan an edit it will not be allowed to make. laravel/mcp also refuses a call to a tool that is not listed, so a client cannot call it by remembering its name.</p>
<p><strong>The check at the top of <code>handle()</code></strong> looks redundant, and over MCP it is. It is there for the day the same tool class is handed to a model by another road, such as an in-app chat built on the Laravel AI SDK, where nobody filtered the list first.</p>
<p><strong>The policy</strong> is the check that matters per record. It is the same <code>Post<wbr>Policy</code> your controllers already use:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> update</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">User</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $user, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Post</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $post)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> bool</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $user</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">id </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">===</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">user_id </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">||</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $user</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">is_editor;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>An author's agent edits the author's posts, and an editor's agent edits any post. You wrote no new rule for the agent, which is the whole point.</p>
<h2 id="refusals-the-model-can-read" tabindex="-1">Refusals the model can read <a class="header-anchor" href="#refusals-the-model-can-read" aria-label="Permalink to &quot;Refusals the model can read&quot;">&ZeroWidthSpace;</a></h2>
<p>Every &quot;no&quot; here is a <code>Response::<wbr>error()</code> with a sentence, not an exception and not a 403. The model gets the sentence back as the tool's result. Then it can tell the user &quot;that post belongs to another author&quot; or try something else, instead of retrying a call it cannot win. A failed <code>validate()</code> comes back the same way, with the validator's messages.</p>
<p>Write those sentences for the person who will read them in the chat, because that is who sees them in the end.</p>
<h2 id="test-it-like-any-other-code" tabindex="-1">Test it like any other code <a class="header-anchor" href="#test-it-like-any-other-code" aria-label="Permalink to &quot;Test it like any other code&quot;">&ZeroWidthSpace;</a></h2>
<p>laravel/mcp has testing helpers on the server class, and <code>Sanctum::<wbr>acting<wbr>As()</code> sets the token's abilities:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\Mcp\Servers\BlogServer</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\Mcp\Tools\ListPosts</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\Mcp\Tools\UpdatePost</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Laravel\Sanctum\Sanctum</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">it</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'hides the write tool from a read-only token'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> () {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    Sanctum</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">actingAs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">User</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">factory</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(), [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'posts:read'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    BlogServer</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">tools</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        -></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertRegistered</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">ListPosts</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        -></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertNotRegistered</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">UpdatePost</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">});</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">it</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'lets an author edit only their own posts'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> () {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    $ann </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> User</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">factory</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    $own </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">factory</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($ann)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    $other </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">factory</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'His'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    Sanctum</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">actingAs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($ann, [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'posts:read'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'posts:write'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    BlogServer</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">tool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">UpdatePost</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'id'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $own</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">id, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Better title'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">])</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        -></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertOk</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        -></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertSee</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Better title'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    BlogServer</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">tool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">UpdatePost</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'id'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $other</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">id, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Hijacked'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">])</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        -></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertHasErrors</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'You may not edit this post: it belongs to another author.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">    expect</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($other</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">fresh</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">title)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">toBe</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'His'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">});</span></span></code></pre>
</div><h2 id="a-few-more-rules-worth-copying" tabindex="-1">A few more rules worth copying <a class="header-anchor" href="#a-few-more-rules-worth-copying" aria-label="Permalink to &quot;A few more rules worth copying&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>Rate-limit by user, not by IP.</strong> <code>auth:<wbr>sanctum</code> runs before <code>throttle</code>, so the limiter counts each user's calls. An agent in a loop then slows down only that user.</li>
<li><strong>Make drafts by default.</strong> If a tool creates records, give it a <code>status</code> argument that defaults to draft, and say in the server's <code>$instructions</code> to publish only when asked.</li>
<li><strong>Never delete for good.</strong> Give the agent a trash or a status, not <code>force<wbr>Delete()</code>. An agent that misunderstood a request is then one restore away from fine.</li>
<li><strong>Log what the agent did, and as whom.</strong> Your activity log already records the user, so the agent's changes show up under the person who connected it.</li>
<li><strong>Revoke means stop.</strong> Deleting the token ends the agent's access on its next call, and nothing else needs to change.</li>
</ul>
<h2 id="where-this-comes-from" tabindex="-1">Where this comes from <a class="header-anchor" href="#where-this-comes-from" aria-label="Permalink to &quot;Where this comes from&quot;">&ZeroWidthSpace;</a></h2>
<p>This is the shape of the MCP server in <a href="https://kitloom.dev" target="_blank" rel="noreferrer">kitloom</a>, a Laravel CMS where every installed module brings its own agent tools. Each tool declares a permission and whether it writes, and the server applies the three checks above. The pattern does not need kitloom, though. It needs laravel/mcp, Sanctum and the policies you already have.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Laravel page cache invalidation: clear only the pages a save changed</title>
      <link>https://kitloom.dev/blog/laravel-page-cache-invalidation.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/laravel-page-cache-invalidation.html</guid>
      <pubDate>Thu, 29 Oct 2026 12:00:00 GMT</pubDate>
      <description>A full-page cache in Laravel that knows which rows each page read: a draft saved leaves the home page cached, a published post moves it. Built on DB::listen, model events and a version per key.</description>
      <content:encoded><![CDATA[<p>A full-page cache is the cheapest speed-up a content site has. A guest asks for <code>/</code>, you send HTML from the cache, and PHP never touches the database. The hard part is knowing when to throw a page away.</p>
<p>Most setups pick one of two answers. Either every save clears the whole cache, or every page expires after a few minutes. The first throws away a thousand good pages because an editor fixed a typo in a draft. The second shows a stale page until the timer runs out.</p>
<p>There is a third answer. <strong>Each page remembers what it read, and each save says what it wrote.</strong> A page is thrown away only when a save touched something it read. A draft saved leaves the home page alone, because the home page lists published posts only. A published post saved moves the home page, and moves that post's own page, but not the page of the post next to it.</p>
<p>This post builds that in about 200 lines of Laravel: <code>DB::<wbr>listen</code>, model events and a cache store. The whole example runs as a test suite, which is at the end.</p>
<h2 id="names-for-what-a-page-read" tabindex="-1">Names for what a page read <a class="header-anchor" href="#names-for-what-a-page-read" aria-label="Permalink to &quot;Names for what a page read&quot;">&ZeroWidthSpace;</a></h2>
<p>Everything hinges on one idea: a read and a write must name the same thing the same way. We use three kinds of keys:</p>
<ul>
<li><code>posts</code>: the whole table, for a read we cannot narrow down (<code>select count(*) from posts</code>);</li>
<li><code>posts:<wbr>id=5</code>: one row, for <code>Post::<wbr>find(5)</code>;</li>
<li><code>posts:<wbr>status=publish</code>: a list, for <code>Post::<wbr>where('status', 'publish')</code>.</li>
</ul>
<p>A read records the most specific key it can prove. A write emits every key it could have changed: the table, the row, and each list the row was in before and after the save.</p>
<p>The rule that keeps this honest: <strong>when unsure, take a coarser key, never a finer one.</strong> A coarse key only costs a cache miss, while a key that is too fine shows a stale page.</p>
<h2 id="keys-from-sql" tabindex="-1">Keys from SQL <a class="header-anchor" href="#keys-from-sql" aria-label="Permalink to &quot;Keys from SQL&quot;">&ZeroWidthSpace;</a></h2>
<p>Every query passes through <code>DB::<wbr>listen</code> with its SQL and bindings. We read the SQL only as far as we can be sure of it:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">namespace</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> App\PageCache</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Illuminate\Database\Eloquent\Model</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">final</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> DependencyKeys</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    /** Tables that show on pages: the primary key first, then the columns lists are asked by. */</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> TRACKED</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">        'posts'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'id'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'status'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">],</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    ];</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    /** </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">@return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> list</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">&#x3C;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">string</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">> */</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> static</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> forRead</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $sql, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $bindings)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $sql </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> strtolower</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">str_replace</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'"'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'`'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">''</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, $sql));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">        preg_match_all</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/</span><span style="--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold">\b</span><span style="--shiki-light:#032F62;--shiki-dark:#DBEDFF">(?:from|join) (</span><span style="--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold">\w</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">+</span><span style="--shiki-light:#032F62;--shiki-dark:#DBEDFF">)</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, $sql, $matches);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $tables </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> array_values</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">array_intersect</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">array_unique</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($matches[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">array_keys</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">self::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">TRACKED</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($tables </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">===</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> []) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">        // Anything we cannot read for sure falls back to the whole table: a coarser key, never a finer one.</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">count</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($matches[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ||</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> preg_match</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/</span><span style="--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold">\b</span><span style="--shiki-light:#032F62;--shiki-dark:#DBEDFF">(or|not|union|exists)</span><span style="--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold">\b</span><span style="--shiki-light:#032F62;--shiki-dark:#DBEDFF">|</span><span style="--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold">\(</span><span style="--shiki-light:#032F62;--shiki-dark:#DBEDFF">select</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, $sql)) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $tables;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $table </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $tables[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        [$primary, $columns] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">self::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">TRACKED</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">[$table][</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">self::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">TRACKED</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">[$table]];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $equals </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [];</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">        preg_match_all</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/</span><span style="--shiki-light:#032F62;--shiki-dark:#DBEDFF">(?:</span><span style="--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold">\w</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">+</span><span style="--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold">\.</span><span style="--shiki-light:#032F62;--shiki-dark:#DBEDFF">)?(</span><span style="--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold">\w</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">+</span><span style="--shiki-light:#032F62;--shiki-dark:#DBEDFF">) = </span><span style="--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold">\?</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, $sql, $conditions, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">PREG_OFFSET_CAPTURE</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        foreach</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($conditions[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">as</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [$column, $offset]) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">            $position </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> substr_count</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">substr</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($sql, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, $offset), </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'?'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">in_array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($column, $columns, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">&#x26;&#x26;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> array_key_exists</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($position, $bindings)) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">                $equals[$column] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $bindings[$position];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">            }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $key </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> match</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">            isset</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($equals[$primary]) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> "{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$table</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}:{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$primary</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}={</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$equals</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">[</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$primary</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">]}"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">            $equals </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!==</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $table</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">':'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">array_key_first</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($equals)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">.</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'='</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">reset</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($equals),</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            default</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        };</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $key </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">===</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> null</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ?</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [$table] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [$key, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$table</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}#all"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>A few things make this safe rather than clever:</p>
<ul>
<li><strong>Only <code>=</code> in a plain <code>and</code> counts.</strong> If the query also says <code>created_<wbr>at &gt; ?</code>, we ignore that part. The key <code>posts:<wbr>status=publish</code> covers more rows than the query read, which is the safe direction.</li>
<li><strong><code>or</code>, <code>not</code>, a join or a subquery means the whole table.</strong> Reading those properly takes a real SQL parser. Without one, the table key is the honest answer.</li>
<li><strong>Tables you do not list are ignored.</strong> Sessions, jobs and the cache table are on no page.</li>
<li><strong><code>posts#all</code> comes with every narrow key.</strong> That is the escape hatch for writes we cannot see into, explained below.</li>
</ul>
<h2 id="keys-from-a-save" tabindex="-1">Keys from a save <a class="header-anchor" href="#keys-from-a-save" aria-label="Permalink to &quot;Keys from a save&quot;">&ZeroWidthSpace;</a></h2>
<p>Eloquent writes come with the model, so we know exactly what changed:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    /** </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">@return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> list</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">&#x3C;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">string</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">> */</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> static</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> forModel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Model</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $model)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $table </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $model</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getTable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> isset</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">self::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">TRACKED</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">[$table])) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        [$primary, $columns] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">self::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">TRACKED</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">[$table][</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">array_slice</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">self::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">TRACKED</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">[$table], </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $keys </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [$table, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$table</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}:{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$primary</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}={</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$model</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getKey</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">()}"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">];</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        foreach</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($columns </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">as</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $column) {</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">            // Before and after: a post leaving a list moves it as much as one joining it.</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            foreach</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ([$model</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getOriginal</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($column), $model</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getAttribute</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($column)] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">as</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $value) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">                if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($value </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!==</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">                    $keys[] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> "{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$table</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}:{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$column</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}={</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$value</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">                }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">            }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> array_values</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">array_unique</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($keys));</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span></code></pre>
</div><p>In the <code>saved</code> event, <code>get<wbr>Original()</code> still holds the values from before the save. So unpublishing a post emits both <code>posts:<wbr>status=publish</code> and <code>posts:<wbr>status=draft</code>, and the home page drops it.</p>
<p>A write that skips the model, such as <code>DB::<wbr>table('posts')-<wbr>&gt;update(...<wbr>)</code> or <code>Post::<wbr>where(...<wbr>)-<wbr>&gt;update(...<wbr>)</code>, gives us only SQL. We cannot tell which rows changed or what their status was, so it moves the whole table and every narrow key of it:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    /** </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">@return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> list</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">&#x3C;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">string</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">> */</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> static</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> forRawWrite</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $sql)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $sql </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> strtolower</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">str_replace</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'"'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'`'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">''</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, $sql));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> preg_match</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">^</span><span style="--shiki-light:#032F62;--shiki-dark:#DBEDFF">(?:insert into|update|delete from) (</span><span style="--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold">\w</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">+</span><span style="--shiki-light:#032F62;--shiki-dark:#DBEDFF">)</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, $sql, $match) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">||</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> !</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> isset</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">self::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">TRACKED</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">[$match[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]])) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">        // No idea which rows changed: the table, and every key of it.</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [$match[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$match</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">1</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">]}#all"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span></code></pre>
</div><h2 id="a-version-per-key-not-a-list-of-pages-per-key" tabindex="-1">A version per key, not a list of pages per key <a class="header-anchor" href="#a-version-per-key-not-a-list-of-pages-per-key" aria-label="Permalink to &quot;A version per key, not a list of pages per key&quot;">&ZeroWidthSpace;</a></h2>
<p>The obvious design keeps a list of pages for each key and deletes them on a write. That needs a reverse index, cleanup, and locking when two servers write at once.</p>
<p>There is a simpler way. Keep <strong>one integer per key</strong>. A cached page stores the version of each key it read. On a hit, one <code>many()</code> call fetches the current versions. If any of them moved, it is a miss. A write only increments.</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">namespace</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> App\PageCache</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Illuminate\Support\Facades\Cache</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">final</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> KeyVersions</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    /** </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">@return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">&#x3C;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">string</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">, int> */</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> current</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $keys)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $keys </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> array_values</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">array_unique</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($keys));</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $stored </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $keys </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">===</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Cache</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getStore</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">many</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">array_map</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">fn</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($key) => </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'dep:'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$key, $keys));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> array_combine</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($keys, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">array_map</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">fn</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($key) => (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">int</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) ($stored[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'dep:'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$key] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">??</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">), $keys)) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> moved</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $seen)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> bool</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">current</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">array_keys</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($seen)) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $seen;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> bump</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $keys)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> void</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        foreach</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">array_unique</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($keys) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">as</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $key) {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">            Cache</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getStore</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">increment</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'dep:'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$key);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>It works with any store that can <code>increment</code>: Redis, Memcached, database, file. Several servers sharing one store agree without coordinating. An evicted version reads as 0, which is a miss, the safe direction again.</p>
<p>One detail we learned the hard way: call <code>Cache::<wbr>get<wbr>Store()</code>, not <code>Cache::<wbr>many()</code>. The repository fires a cache event for every key, and a page holds dozens of keys. With Laravel Pulse recording cache events, that doubled the time of a hit.</p>
<h2 id="the-request-s-log" tabindex="-1">The request's log <a class="header-anchor" href="#the-request-s-log" aria-label="Permalink to &quot;The request's log&quot;">&ZeroWidthSpace;</a></h2>
<p>What a page read is per request, so it lives in a <code>scoped()</code> binding. That keeps it safe on Octane, where a singleton would carry one request's keys into the next:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">namespace</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> App\PageCache</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">final</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> ReadLog</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    private</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ?array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $keys </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    /** </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">@var</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">&#x3C;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">string</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">, int> */</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    private</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $modelWrites </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [];</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> start</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> void</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">        $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">keys </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    /** </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">@return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> list</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">&#x3C;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">string</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">> */</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> stop</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        [$keys, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">$this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">keys] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">array_keys</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">$this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">keys </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">??</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> []), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">];</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $keys;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> read</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $keys)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> void</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">$this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">keys </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!==</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">            $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">keys </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">+=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> array_fill_keys</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($keys, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> expectModelWrite</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $table)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> void</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">        $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">modelWrites[$table] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">$this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">modelWrites[$table] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">??</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> isModelWrite</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $table)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> bool</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ((</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">$this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">modelWrites[$table] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">??</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">===</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">        $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">modelWrites[$table]</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">--</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p><code>expect<wbr>Model<wbr>Write()</code> solves a small puzzle. A model save also runs an <code>update</code> statement, and <code>DB::<wbr>listen</code> sees it as a raw write. If we let it through, every model save would move <code>posts#all</code> and throw away every page of the table. So the <code>updating</code> event says the next statement on this table is the model's, and the listener lets that one statement pass. The model's own <code>saved</code> event then emits the precise keys.</p>
<h2 id="wiring-it-up" tabindex="-1">Wiring it up <a class="header-anchor" href="#wiring-it-up" aria-label="Permalink to &quot;Wiring it up&quot;">&ZeroWidthSpace;</a></h2>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// AppServiceProvider</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\PageCache\DependencyKeys</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\PageCache\KeyVersions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\PageCache\ReadLog</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Illuminate\Database\Events\QueryExecuted</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Illuminate\Support\Facades\DB</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Illuminate\Support\Facades\Event</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> register</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> void</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">app</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">scoped</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">ReadLog</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> boot</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> void</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    DB</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">listen</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">QueryExecuted</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $query)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $log </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">app</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">make</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">ReadLog</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">str_starts_with</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">strtolower</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">ltrim</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($query</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">sql)), </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'select'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">            $log</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">read</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">DependencyKeys</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">forRead</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($query</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">sql, $query</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">bindings));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $keys </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> DependencyKeys</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">forRawWrite</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($query</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">sql);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($keys </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!==</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">&#x26;&#x26;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> !</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $log</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">isModelWrite</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($keys[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">])) {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">            $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">app</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">make</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">KeyVersions</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">bump</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($keys);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    });</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    Event</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">listen</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'eloquent.creating: *'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'eloquent.updating: *'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'eloquent.deleting: *'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $event, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $data)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">isset</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">DependencyKeys</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">TRACKED</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">[$data[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getTable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()])) {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">            $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">app</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">make</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">ReadLog</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">expectModelWrite</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($data[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getTable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">());</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    });</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    Event</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">listen</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'eloquent.saved: *'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'eloquent.deleted: *'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $event, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $data)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">        $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">app</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">make</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">KeyVersions</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">bump</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">DependencyKeys</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">forModel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($data[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]));</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    });</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><h2 id="the-middleware" tabindex="-1">The middleware <a class="header-anchor" href="#the-middleware" aria-label="Permalink to &quot;The middleware&quot;">&ZeroWidthSpace;</a></h2>
<p>The middleware caches only guests' GET requests that answer 200, and only on routes you give it:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">namespace</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> App\Http\Middleware</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\PageCache\KeyVersions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> App\PageCache\ReadLog</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Closure</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Illuminate\Http\Request</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Illuminate\Support\Facades\Cache</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Symfony\Component\HttpFoundation\Response</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">final</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> CachePages</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> __construct</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">private</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> ReadLog</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $log, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">private</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> KeyVersions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $versions) {}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> handle</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Request</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $request, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Closure</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $next)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Response</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">isMethod</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'GET'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">||</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">user</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!==</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $next($request);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $key </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'page:'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">sha1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">fullUrl</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">());</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $page </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Cache</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($key);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">is_array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($page) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">&#x26;&#x26;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> !</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">versions</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">moved</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($page[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'deps'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">])) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> response</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($page[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'body'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">])</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">header</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Content-Type'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, $page[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'type'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">])</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">header</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'X-Page-Cache'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'hit'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">        $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">log</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">start</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $response </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $next($request);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $keys </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">log</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">stop</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($response</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getStatusCode</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">===</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 200</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">            Cache</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">put</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($key, [</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">                'body'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $response</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getContent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(),</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">                'type'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $response</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">headers</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Content-Type'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">),</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">                'deps'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">versions</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">current</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">($keys),</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">            ], </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">now</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">addHour</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">());</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $response</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">headers</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">set</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'X-Page-Cache'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'miss'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $response;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Route</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">middleware</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">CachePages</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">group</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> () {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    Route</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">HomeController</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    Route</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/posts/{post}'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">PostController</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'show'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">});</span></span></code></pre>
</div><h2 id="prove-it-with-tests" tabindex="-1">Prove it with tests <a class="header-anchor" href="#prove-it-with-tests" aria-label="Permalink to &quot;Prove it with tests&quot;">&ZeroWidthSpace;</a></h2>
<p>The tests describe the behaviour better than prose does:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">it</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'leaves the home page cached when a draft is saved'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> () {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    Post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Hello'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'status'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'publish'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    $draft </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Draft'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'status'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'draft'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertHeader</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'X-Page-Cache'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'miss'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertHeader</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'X-Page-Cache'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'hit'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    $draft</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">update</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Better draft'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertHeader</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'X-Page-Cache'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'hit'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">});</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">it</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'moves a post page only with its own post'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> () {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    [$one, $two] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">factory</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">published</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">count</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"/posts/{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$one</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">id</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"/posts/{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$two</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">id</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    $two</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">update</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Two, edited'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"/posts/{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$one</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">id</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertHeader</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'X-Page-Cache'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'hit'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"/posts/{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$two</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">id</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertHeader</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'X-Page-Cache'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'miss'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">});</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">it</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'drops an unpublished post from the list'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> () {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    $post </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Soon'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'status'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'publish'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertSee</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Soon'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    $post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">update</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'status'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'draft'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertDontSee</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Soon'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">});</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">it</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'moves every page of the table on a raw update'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> () {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    $post </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">create</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'One'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'status'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'publish'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    DB</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">table</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'posts'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">where</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'id'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, $post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">id)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">update</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'Renamed'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">]);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    $this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">assertSee</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'Renamed'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">});</span></span></code></pre>
</div><p>We also broke the code on purpose to check that the tests notice. Without the row key, the draft test and the post page test fail. Without the &quot;before&quot; value of <code>status</code>, the unpublish test fails. Without <code>posts#all</code> on raw writes, the raw update test fails.</p>
<h2 id="what-this-does-not-do" tabindex="-1">What this does not do <a class="header-anchor" href="#what-this-does-not-do" aria-label="Permalink to &quot;What this does not do&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>A race between drawing and storing.</strong> The versions are taken after the page is drawn. If a save lands between the query and that moment, the page is stored with the new version but the old content, and it stays until its TTL runs out. Keep the TTL short enough that this is acceptable, or take the versions as each query runs, at the cost of one cache call per query.</li>
<li><strong>Joins and <code>or</code> are table-wide.</strong> A real parser narrows them too. Until you write one, add the columns your lists filter by to <code>TRACKED</code>, and look at which queries still fall back to the whole table.</li>
<li><strong>Pages that depend on the visitor</strong> (a cart count, &quot;Hello, Ann&quot;) must stay out of the cache, or draw that part with JavaScript.</li>
<li><strong>Keys live for good.</strong> That is one small integer per row or list that anyone ever asked about. On Redis it is nothing, but on a store that evicts, an evicted key is a miss.</li>
</ul>
<h2 id="where-this-comes-from" tabindex="-1">Where this comes from <a class="header-anchor" href="#where-this-comes-from" aria-label="Permalink to &quot;Where this comes from&quot;">&ZeroWidthSpace;</a></h2>
<p>This is a smaller version of the page cache in <a href="https://kitloom.dev" target="_blank" rel="noreferrer">kitloom</a>, a Laravel CMS on WordPress's tables. There, a proper SQL parser reads joins, <code>or</code> and subqueries, and lists are keyed by combinations of columns such as <code>post_<wbr>type</code> and <code>post_<wbr>status</code>. Static HTML files carry their own keys too. In its benchmark, with an editor saving posts during the run, about half as many requests missed the cache as with &quot;every save clears everything&quot;, for about a millisecond more per hit. The idea needs none of that, though: <code>DB::<wbr>listen</code>, two model events and one integer per key.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Laravel Telescope in production — only the slow and failed requests, with everything they ran</title>
      <link>https://kitloom.dev/blog/laravel-telescope-in-production.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/laravel-telescope-in-production.html</guid>
      <pubDate>Thu, 29 Oct 2026 12:00:00 GMT</pubDate>
      <description>Laravel Telescope on a live Laravel site: administrators open it, it keeps what went wrong with its queries, leaves out cached pages and admin noise, hides secrets, prunes itself, and an AI agent reads it.</description>
      <content:encoded><![CDATA[<p>Telescope is the best answer Laravel has to &quot;what exactly happened in that request&quot;. It writes down each request with its input and answer, every database query with the line that ran it, each queued job with its data, each exception with its stack trace. You open one entry and see the whole story.</p>
<p>On a live site it is usually switched off, for three reasons. Out of the box nobody may open it outside <code>local</code> until someone writes the gate. Left as it is, it records every request and every query, and the table grows by hundreds of megabytes a day. And on a CMS most of what it records is noise: the admin polling itself, the toolbar's calls, pages served from the cache. Every page of the site also goes through one route, so the list says <code>/<wbr>{any}</code> where you want to know &quot;the category page&quot;.</p>
<p>kitloom/telescope keeps Telescope on in production and makes it answer the question you have.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> connected, an agent whose user may open Telescope calls <code>telescope_<wbr>report</code>:</p>
<ul>
<li><em>&quot;What broke on the site since yesterday?&quot;</em></li>
<li><em>&quot;Which pages were slowest this afternoon, and what queries made them slow?&quot;</em></li>
<li><em>&quot;Did any queued job fail overnight?&quot;</em></li>
</ul>
<p>It gets exceptions grouped by class and line with how often, the slowest requests with their path, status and page template, failed jobs with their module and error, and slow queries grouped by shape. It never gets request bodies, headers, sessions, emails or job data, and the values in a query come back as <code>?</code>. The agent then looks at the module that runs the query, or tells you which page to open, with exactly the rights its key gives it. How to connect one: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="what-it-keeps" tabindex="-1">What it keeps <a class="header-anchor" href="#what-it-keeps" aria-label="Permalink to &quot;What it keeps&quot;">&ZeroWidthSpace;</a></h2>
<p>On <code>local</code>, everything Telescope records. On the live site, what <strong>Telescope → Settings</strong> asks for:</p>
<table tabindex="0">
<thead>
<tr>
<th>Kept</th>
<th>How</th>
</tr>
</thead>
<tbody>
<tr>
<td>A request slower than <strong>Slow request</strong> (1000 ms by default)</td>
<td>With everything recorded during it: queries, models, views, cache, events</td>
</tr>
<tr>
<td>A request that answered 4xx or 5xx</td>
<td>The same</td>
</tr>
<tr>
<td>An exception</td>
<td>With the request or job it was thrown in</td>
</tr>
<tr>
<td>A query slower than <strong>Slow query</strong> (100 ms)</td>
<td>With the request or job that ran it</td>
</tr>
<tr>
<td>A queued job, a scheduled task, an outgoing HTTP call, a notification</td>
<td>Each alone</td>
</tr>
</tbody>
</table>
<p>A slow page comes with the queries that made it slow, not as one lonely line. Never recorded: a page the page cache answered, Livewire's polling of the admin, the admin bar's own calls, files served through PHP, Telescope itself. <strong>Record everything</strong> turns the filter off while you look into something; turn it off again afterwards.</p>
<h2 id="find-a-page-by-its-template" tabindex="-1">Find a page by its template <a class="header-anchor" href="#find-a-page-by-its-template" aria-label="Permalink to &quot;Find a page by its template&quot;">&ZeroWidthSpace;</a></h2>
<p>Telescope tags entries so its search can find them. kitloom adds the names a CMS needs:</p>
<ul>
<li><code>template:<wbr>single-<wbr>product</code>, <code>template:<wbr>taxonomy-<wbr>product_<wbr>cat</code>, <code>template:<wbr>search</code>, <code>template:<wbr>404</code> — the template the page was drawn with, the way WordPress's template hierarchy names it;</li>
<li><code>post:<wbr>12</code>, <code>term:<wbr>5</code>, <code>user:<wbr>7</code> — the record the page shows;</li>
<li><code>module:<wbr>bookings</code>, <code>module:<wbr>webhooks</code> — on a job, a notification or an email of a kitloom module.</li>
</ul>
<p>&quot;The dried fruit category is slow&quot; becomes <code>template:<wbr>taxonomy-<wbr>product_<wbr>cat</code> in the search box, one click on the request, and the Queries tab saying how many of its queries were repeated.</p>
<h2 id="secrets-stay-out" tabindex="-1">Secrets stay out <a class="header-anchor" href="#secrets-stay-out" aria-label="Permalink to &quot;Secrets stay out&quot;">&ZeroWidthSpace;</a></h2>
<p>Telescope stores what a request sent. The module hides passwords, tokens and cookies by name, and also anything whose name looks like a secret — <code>smtp_<wbr>pass</code>, <code>api_<wbr>key</code>, <code>x-<wbr>api-<wbr>key</code>, <code>?token=</code> — in the site's own requests, in settings saved from the admin, and in calls to other services. Names, emails and form fields are stored as sent; that is why only users with <strong>Open the Telescope dashboard</strong> (<code>view_<wbr>telescope</code>, administrators from the start) get in, in every environment.</p>
<h2 id="it-looks-after-itself" tabindex="-1">It looks after itself <a class="header-anchor" href="#it-looks-after-itself" aria-label="Permalink to &quot;It looks after itself&quot;">&ZeroWidthSpace;</a></h2>
<p><code>telescope:<wbr>prune</code> runs every night with the hours of <strong>Keep entries</strong> (48 by default). The migration runs from the package with the site's table prefix, so <code>telescope:<wbr>install</code> is not needed; the dashboard's styles and scripts come from the package too. The admin's <strong>Telescope</strong> section has a badge that says whether it records, is paused, is off in the environment (<code>TELESCOPE_<wbr>ENABLED=false</code>), or still waits for <code>php artisan migrate</code>. Emails are left to the Emails module, which keeps them with their text.</p>
<h2 id="telescope-pulse-horizon-emails" tabindex="-1">Telescope, Pulse, Horizon, Emails <a class="header-anchor" href="#telescope-pulse-horizon-emails" aria-label="Permalink to &quot;Telescope, Pulse, Horizon, Emails&quot;">&ZeroWidthSpace;</a></h2>
<table tabindex="0">
<thead>
<tr>
<th>Module</th>
<th>Shows</th>
<th>For</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Telescope</strong></td>
<td>Each recorded request, query, job and exception, one by one</td>
<td>Why one thing went wrong or was slow</td>
</tr>
<tr>
<td><a href="https://kitloom.dev/docs/modules/guides/pulse.html">Pulse</a></td>
<td>Totals and averages: slowest pages, queries, jobs, servers</td>
<td>How the site does in general</td>
</tr>
<tr>
<td><a href="https://kitloom.dev/docs/modules/guides/horizon.html">Horizon</a></td>
<td>The workers of a queue on Redis</td>
<td>Running the queue</td>
</tr>
<tr>
<td><a href="https://kitloom.dev/docs/modules/guides/emails.html">Emails</a></td>
<td>Every email sent, with its body</td>
<td>What a customer received</td>
</tr>
</tbody>
</table>
<p>Telescope sees jobs on any queue, the <code>database</code> queue included.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>It is <code>laravel/<wbr>telescope</code> 5 as it is; the module adds hooks. A batch filter (<code>Telescope::<wbr>filter<wbr>Batch</code>) decides per request or job, so a problem keeps its context and an ordinary page leaves only the entries asked for one by one; the decisions are <code>Kitloom\<wbr>Telescope\<wbr>Recording</code>, and the settings are read at each decision, never written into <code>telescope.<wbr>*</code> config, so <code>config:<wbr>cache</code> and Octane are safe. <code>kitloom-<wbr>telescope.<wbr>filter</code> set to <code>false</code> leaves recording to your own filters, <code>kitloom-<wbr>telescope.<wbr>authorize</code> to your own <code>Telescope::<wbr>auth()</code>. The tags listen to kitloom/site's <code>Main<wbr>Query<wbr>Resolved</code> event. Everything is in the <a href="https://kitloom.dev/docs/modules/guides/telescope.html">guide</a>.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/telescope/filament/find-a-slow-page.jpg" src="https://media.kitloom.dev/lessons/telescope/filament/find-a-slow-page.mp4"></video>
  <figcaption>Find a slow page with Telescope: its template in the search, the request, its repeated queries</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/telescope/filament/settings.jpg" src="https://media.kitloom.dev/lessons/telescope/filament/settings.mp4"></video>
  <figcaption>Telescope settings: what the live site records, what counts as slow, how long it is kept</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail of the module is in the <a href="https://kitloom.dev/docs/modules/guides/telescope.html">Telescope guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Why is this page slow? One-page inspection for a Laravel site</title>
      <link>https://kitloom.dev/blog/why-is-this-page-slow-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/why-is-this-page-slow-laravel.html</guid>
      <pubDate>Thu, 29 Oct 2026 12:00:00 GMT</pubDate>
      <description>A page inspector for a Laravel CMS: the template it was drawn with, every query with its time, exact duplicates and N+1 repeats, the page cache's verdict — from the admin bar, the console and an AI agent, for one address.</description>
      <content:encoded><![CDATA[<p>The complaint never comes as &quot;the site is slow&quot;. It comes as &quot;the category page is slow&quot;, or &quot;the home page takes two seconds since Tuesday&quot;. You have Pulse, Telescope or Debugbar, and each of them answers a different question. Pulse says which requests were slow over the last hour, averaged over everyone. Telescope records every request, and finding the one you mean is a search. Debugbar shows the queries of the page you are on — in development, where the data is small and the page is fast.</p>
<p>What the complaint asks for is simpler: <strong>draw this one page once, as a visitor would get it, and tell me everything it did.</strong> Which template drew it. Every query it ran, with its time. Which queries ran twice. Whether the cache would have kept it, and if not, why. kitloom has that now, for one address, in three places.</p>
<h2 id="ask-an-agent-first" tabindex="-1">Ask an agent first <a class="header-anchor" href="#ask-an-agent-first" aria-label="Permalink to &quot;Ask an agent first&quot;">&ZeroWidthSpace;</a></h2>
<p>The fastest way to use it is not to open anything. An agent connected through <a href="https://kitloom.dev/docs/ai.html">kitloom/ai</a> has the <code>site_<wbr>inspect_<wbr>page</code> tool, as the user whose key it holds:</p>
<blockquote>
<p><em>&quot;Why is <code>/<wbr>category/<wbr>dried-<wbr>fruit/</code> slow?&quot;</em></p>
</blockquote>
<p>The agent draws the page, reads the inspection and answers in words — say, forty-one queries in thirty milliseconds, one of them run eight times with different ids, the product images read per product instead of for the list, and the page not cached because the address carries a sort parameter nobody declared. Then it can look at the module that runs the query, or clear the cache with <code>site_<wbr>cache_<wbr>clear</code>, with exactly the rights its key gives it. The tool reads only; it needs <code>manage_<wbr>options</code>, as the Cache settings do.</p>
<h2 id="in-the-admin-bar" tabindex="-1">In the admin bar <a class="header-anchor" href="#in-the-admin-bar" aria-label="Permalink to &quot;In the admin bar&quot;">&ZeroWidthSpace;</a></h2>
<p>For a person, the same report sits on the page itself. Once <strong>Admin Bar → Settings → Show Inspect in the bar</strong> is on, every page of the site shows <strong>Inspect</strong> in the toolbar to users who manage the site's settings. A click draws the page once more and opens a panel under the bar:</p>
<ul>
<li><strong>Template</strong> — the file of the theme that drew the page, and the candidates it was chosen from, most specific first, the way WordPress's template hierarchy orders them (<code>single-<wbr>post-<wbr>reading-<wbr>middlemarch-<wbr>slowly</code>, <code>single-<wbr>post</code>, <code>single</code>, <code>singular</code>, <code>index</code>).</li>
<li><strong>Queries</strong> — how many, in how long. <strong>Exact duplicates</strong> first: the same SQL with the same values run more than once, something read twice that could have been read once. Then <strong>repeated with other values</strong>: the same SQL once per row, the N+1 that a list of posts makes when each one reads its own terms. Then the five slowest.</li>
<li><strong>Cache</strong> — whether a guest's copy of this address would be kept and, when not, why: the cache is off, the address has a query parameter nobody declared, a module keeps the request out. And whether a copy is in the cache right now.</li>
<li><strong>Timing</strong> — the main query on its own, then the whole page, with peak memory.</li>
</ul>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" src="https://media.kitloom.dev/lessons/admin-bar/filament/inspect.mp4#t=3"></video>
  <figcaption>Inspect switched on, the panel on the home page: template, queries, duplicates and repeats, cache, timing</figcaption>
</figure>
</div>
<p>It is off until the owner switches it on: a click draws a page, and nobody should be able to ask a server for that by default. Guests never see it, and a page the cache keeps never carries it, because the bar is not cached either.</p>
<h2 id="from-the-console" tabindex="-1">From the console <a class="header-anchor" href="#from-the-console" aria-label="Permalink to &quot;From the console&quot;">&ZeroWidthSpace;</a></h2>
<p>On a server, or in a script before a deploy:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:inspect</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /category/dried-fruit/</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:inspect</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /account/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --as=edith</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">     # as a user: a login, an email or an id</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:inspect</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> /</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --json</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">                  # the whole inspection as data</span></span></code></pre>
</div><p>The report prints the same sections, the queries sorted by time with the duplicates and repeats in tables of their own, and the dependency keys the page read — the rows and lists the page cache would keep it with, which is how you find out that a page depends on a whole table when it should depend on one row.</p>
<h2 id="why-not-debugbar-in-production" tabindex="-1">Why not Debugbar in production <a class="header-anchor" href="#why-not-debugbar-in-production" aria-label="Permalink to &quot;Why not Debugbar in production&quot;">&ZeroWidthSpace;</a></h2>
<p>Laravel Debugbar answers the same question for a developer: open the page, read its queries. The reason it stays off in production is not that it could not run there. It collects on every request, for everyone, and writes itself into every response — a cost on every page and, if the gate is ever misconfigured, the site's SQL on a public page. So it is switched off where the slow page actually is, with the real data, the real cache and the real traffic.</p>
<p>The inspector turns that around. Nothing is collected until someone asks: the listener the page cache already has hands statements to a collector only while an inspection runs, and the rest of the time costs nothing. It draws the one address asked for, as the user who asked, and changes nothing in what visitors get — the page is drawn for the report, not served. Only a user who manages the site's settings can ask, only once the owner switched it on, with a throttle on the route. Nothing is stored. That is what lets it live on the production site, where the question comes up.</p>
<p>It also knows things a generic bar does not: the template hierarchy the page was chosen from, the main query's result, and the page cache's verdict with the keys it would keep the page with — and it answers the console and an agent in the same shape as the panel.</p>
<h2 id="how-it-is-built-in-short" tabindex="-1">How it is built, in short <a class="header-anchor" href="#how-it-is-built-in-short" aria-label="Permalink to &quot;How it is built, in short&quot;">&ZeroWidthSpace;</a></h2>
<p>The inspector lives in the core of the site, next to the page cache, because that is where the pieces already are. The page cache listens to every <code>Query<wbr>Executed</code> event to learn what a page read; while an inspection runs, the same listener hands each statement to a per-request collector, with its SQL, bindings, time and the tables it touched, as the cache's own parser reads them. The address is drawn through the same <code>Site::<wbr>render()</code> the console and the agents use, with the same visibility rules as the request would have — a draft is a 404 for a visitor and a page for its editor. Then the main query is asked on its own, for what it found and how long it takes alone. Nothing is stored, no new table, no dependency: a collector, a grouping, a DTO.</p>
<p>Pulse still answers for the site over time, and Telescope still records everything. This answers the question as it is asked: <em>this</em> page, now.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. The setting and the route are in the <a href="https://kitloom.dev/docs/modules/guides/admin-bar.html">Admin Bar guide</a>; the command, the tool and what each section means are in the site package's &quot;Inspecting a page&quot;.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Google Calendar sync for bookings in Laravel, without OAuth screens</title>
      <link>https://kitloom.dev/blog/google-calendar-sync-for-bookings-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/google-calendar-sync-for-bookings-in-laravel.html</guid>
      <pubDate>Wed, 28 Oct 2026 12:00:00 GMT</pubDate>
      <description>Two-way Google Calendar sync for a salon's bookings on a Laravel site: bookings become events in each staff member's calendar, busy times come back off the booking form, set up with one service account and no sign-in.</description>
      <content:encoded><![CDATA[<p>Ask a salon what their booking page must do and the first answer is not the booking page. It is the stylist's phone: her appointments live in Google Calendar, with her dentist and her daughter's school run, and the site has to know all of it. A booking the site takes over her day off is a client sent home. A booking she takes at the desk and never types into the site is a slot the site sells twice.</p>
<p>Every Laravel booking site solves this again. The Google Calendar API is documented; what takes the week is everything around it — OAuth consent screens for a client who is not a developer, refresh tokens that die after seven days while the consent screen sits in <em>Testing</em>, a sync that must run every few minutes without reading the stylist's private titles, and the one booking that lands exactly while the sync is sleeping. <code>kitloom/<wbr>booking-<wbr>calendars</code> is that week done once, as a module of <a href="https://kitloom.dev/docs/modules/guides/bookings.html">kitloom/bookings</a>.</p>
<h2 id="what-the-salon-gets" tabindex="-1">What the salon gets <a class="header-anchor" href="#what-the-salon-gets" aria-label="Permalink to &quot;What the salon gets&quot;">&ZeroWidthSpace;</a></h2>
<p>Each staff member connects one calendar. From then on:</p>
<ul>
<li><strong>Bookings go in.</strong> A waiting or confirmed booking is an event in their calendar — <em>Haircut — Anna K.</em>, the phone and the note in the description, <em>tentative</em> until they confirm. Moved by the front desk, it moves; given to a colleague, it changes calendars; cancelled, it is gone.</li>
<li><strong>Busy comes back.</strong> What is busy in the calendar — any event, whatever it is — is not offered on the booking form, to clients and to the desk alike. Only the times are read; the titles stay with the staff member.</li>
<li><strong>The moment of booking is checked.</strong> A sync every five minutes is not enough for the appointment the stylist typed a minute ago: inside the booking, the site looks at the calendar once more, three seconds at most, and falls back on the last reading.</li>
</ul>
<p>Nothing of this reaches a client. A calendar that fails lands on its row in the admin with Google's words, Site Health warns, a Telegram channel can be told, and the booking is taken all the same.</p>
<h2 id="set-up-in-the-admin-no-sign-in" tabindex="-1">Set up in the admin, no sign-in <a class="header-anchor" href="#set-up-in-the-admin-no-sign-in" aria-label="Permalink to &quot;Set up in the admin, no sign-in&quot;">&ZeroWidthSpace;</a></h2>
<p>The road most tutorials take is OAuth: a Cloud project, a consent screen, every staff member clicking <em>Allow</em> in a popup, and a refresh token to keep alive. kitloom takes the other road: <strong>one service account for the site, and each staff member shares their calendar with it.</strong></p>
<ol>
<li>In Google Cloud: a project, the <em>Google Calendar API</em> enabled, a service account under <em>Credentials</em>, its JSON key downloaded. Ten minutes, once, no consent screen, nothing to publish.</li>
<li><strong>Booking Calendars → Settings</strong>: paste the key file. The page shows the account's address, <code>booking-<wbr>calendars@…iam.<wbr>gserviceaccount.<wbr>com</code>, and keeps the key encrypted.</li>
<li>Each staff member, in their Google Calendar: <em>Settings and sharing → Share with specific people → that address, Make changes to events</em>. For a second calendar, its id from <em>Integrate calendar</em>.</li>
<li><strong>Booking Calendars → Calendars → New</strong>: the staff member and the address. Saving looks at the calendar through Google at once — <em>Connected</em>, or <em>Not shared</em> with the address to share it with — reads it, and sends the staff member's upcoming bookings into it.</li>
</ol>
<p>Nothing expires. Nobody signs in anywhere. A new staff member is one sharing step.</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/booking-calendars/filament/settings.jpg" src="https://media.kitloom.dev/lessons/booking-calendars/filament/settings.mp4"></video>
  <figcaption>The Google account: the key pasted once, the address the staff share their calendars with</figcaption>
</figure>
</div>
<h2 id="the-parts-you-would-otherwise-build" tabindex="-1">The parts you would otherwise build <a class="header-anchor" href="#the-parts-you-would-otherwise-build" aria-label="Permalink to &quot;The parts you would otherwise build&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>No SDK, no tokens to keep.</strong> Google is called over Laravel's HTTP client with a JWT signed by the key; the access token lives in the cache for its hour.</li>
<li><strong>Pushes from the queue, three tries.</strong> A slow answer from Google never slows a booking; a failure counts on the calendar's row, and five in a row stop pushing to it until a call gets through.</li>
<li><strong>Busy times through a contract.</strong> The module hands its stretches to kitloom/bookings through <code>Busy<wbr>Times</code>, the same door a Microsoft 365 module or a staff member's second job would use.</li>
<li><strong>An event deleted by hand comes back.</strong> The client was promised the time; freeing it is a cancellation on the site, not a deletion in Google.</li>
<li><strong>Privacy follows the data.</strong> The events carry the client's name into Google; <em>Erase Personal Data</em> rewrites them to name nobody.</li>
</ul>
<h2 id="run-it-from-an-ai-agent" tabindex="-1">Run it from an AI agent <a class="header-anchor" href="#run-it-from-an-ai-agent" aria-label="Permalink to &quot;Run it from an AI agent&quot;">&ZeroWidthSpace;</a></h2>
<p>The calendars are open to an agent connected through <code>kitloom/<wbr>ai</code>, as the user whose key it holds:</p>
<ul>
<li><em>&quot;Why isn't Tuesday's booking in Mira's calendar?&quot;</em> — <code>bookings_<wbr>calendars_<wbr>list</code> answers whose calendar is not shared and what Google said.</li>
<li><em>&quot;Mira shared her calendar, check it again.&quot;</em> — <code>bookings_<wbr>calendars_<wbr>sync</code> reads it now and reports the status.</li>
</ul>
<p>Connecting a calendar and saving the key stay in the admin: the key is a secret, and secrets stay out of chats.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail of the module is in the <a href="https://kitloom.dev/docs/modules/guides/booking-calendars.html">Booking Calendars guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Connect Claude or ChatGPT to your Laravel site, with no key to copy</title>
      <link>https://kitloom.dev/blog/connect-claude-or-chatgpt-to-your-laravel-site.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/connect-claude-or-chatgpt-to-your-laravel-site.html</guid>
      <pubDate>Tue, 27 Oct 2026 12:00:00 GMT</pubDate>
      <description>Your Laravel site's MCP server now signs agents in with OAuth: paste the address into claude.ai, ChatGPT, Claude Code, Cursor or VS Code, sign in to the site, approve. Revoke an agent in one click.</description>
      <content:encoded><![CDATA[<p>Every kitloom site has an <a href="https://kitloom.dev/docs/ai.html">MCP server</a> at <code>https://<wbr>your-<wbr>site/<wbr>mcp</code>: an AI agent connected to it writes posts, fixes SEO, answers 404s with redirects and reads the day's orders, with the rights of its user. Until today, connecting one meant a key. You made an application password in the admin, then copied <code>Authorization:<wbr> Bearer 12|…</code> into every client: a header in Claude Code's command, a <code>headers</code> block in Cursor's <code>mcp.<wbr>json</code>, a <em>Request headers</em> field in claude.ai's advanced settings. ChatGPT, whose connectors take no headers, needed the key inside the address itself.</p>
<p>A key copied that way ends up in dotfiles, in screenshots and in chat histories, and nobody remembers which agent holds which one. WordPress has nothing better to offer here: it has no sign-in an MCP client can use, so an agent reaches a WordPress site with an application password too, usually kept in the settings of a proxy on your computer.</p>
<p>Now an agent signs in to your site the way you sign in to an app with Google: you give it the address, the site asks you to approve it, and that is all.</p>
<h2 id="how-it-goes" tabindex="-1">How it goes <a class="header-anchor" href="#how-it-goes" aria-label="Permalink to &quot;How it goes&quot;">&ZeroWidthSpace;</a></h2>
<p>In the admin, <strong>AI agents → Connect an agent</strong> shows the address and what to do in each client.</p>
<p><strong>claude.ai</strong> — on the web, on a phone and in Claude Desktop: <strong>Settings → Connectors → Add custom connector</strong>, any name and the address, the advanced settings left empty, then <strong>Add</strong> and <strong>Connect</strong>.</p>
<p><strong>ChatGPT</strong>: <strong>Settings → Apps &amp; Connectors → Advanced settings</strong>, turn <em>Developer mode</em> on, then <strong>Create</strong> — any name, the address, OAuth as the authentication — and connect.</p>
<p><strong>Claude Code</strong>, with nothing but the address:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">claude</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> mcp</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> add</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --transport</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> http</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> https://your-site/mcp</span></span></code></pre>
</div><p><strong>Cursor and VS Code</strong>: <em>Add to Cursor</em> and <em>Add to VS Code</em> on the same page install the server in one click, or <code>mcp.<wbr>json</code> takes the address alone:</p>
<div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">  "mcpServers"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    "kitloom"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">"url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"https://your-site/mcp"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">  }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>The first time the agent uses the site, a browser window opens. You sign in to the site — two-factor included, if it is on — and see a page of the site's own: which agent asks to connect, where you will be sent back, and what it will be able to do. <strong>Approve</strong>, and the agent is connected. It now works with your rights: it reads what you may read and writes what you may write, through the same code your admin uses.</p>
<h2 id="connected-agents-and-revoke" tabindex="-1">Connected agents, and Revoke <a class="header-anchor" href="#connected-agents-and-revoke" aria-label="Permalink to &quot;Connected agents, and Revoke&quot;">&ZeroWidthSpace;</a></h2>
<p>The agents you approved are listed under <strong>Connected agents</strong> on the same page: the name each gave itself, since when, and when it will ask you to sign in again. <strong>Revoke</strong> stops one at once — its next request is refused, and so is its next attempt to renew its access. To use it again, connect it again. In Nova it is the same panel: tick the agents and press <strong>Save</strong>.</p>
<p>An agent's access lasts a day, and it renews it by itself for 90 days; then it asks you to sign in again. The <a href="https://kitloom.dev/docs/modules/guides/activity-log.html">activity log</a> shows its changes under its user, and every save keeps a revision it can be undone from. An agent that runs a site for you deserves a user of its own with a narrow role — an editor for content, not an administrator: connect it signed in as that user.</p>
<h2 id="what-is-under-it" tabindex="-1">What is under it <a class="header-anchor" href="#what-is-under-it" aria-label="Permalink to &quot;What is under it&quot;">&ZeroWidthSpace;</a></h2>
<p>The sign-in is <a href="https://laravel.com/docs/passport" target="_blank" rel="noreferrer">Laravel Passport</a>, installed with kitloom/ai. Nothing is changed in the application — no <code>api</code> guard, nothing on the user model. A client speaks the MCP authorization spec on its own:</p>
<ul>
<li><code>/<wbr>mcp</code> answers its first request with a 401 that names <code>/.<wbr>well-<wbr>known/<wbr>oauth-<wbr>protected-<wbr>resource/<wbr>mcp</code>, which leads it to the site's sign-in;</li>
<li>it registers itself at <code>POST /<wbr>oauth/<wbr>register</code> (dynamic client registration, ten a minute from one address);</li>
<li>it sends you to <code>/<wbr>oauth/<wbr>authorize</code> with PKCE — the site's own login for a guest, then the approval page — and takes its tokens from <code>/<wbr>oauth/<wbr>token</code>;</li>
<li>one scope, <code>mcp:<wbr>use</code>; clients are sent back only where they registered: claude.ai and ChatGPT to their own pages, Claude Code and VS Code to a loopback address, Cursor to <code>cursor://</code>.</li>
</ul>
<p>While AI agents are off, all of it answers 404; a user without the <em>use AI agents</em> permission is refused on the approval page.</p>
<h2 id="on-a-server-and-on-several" tabindex="-1">On a server, and on several <a class="header-anchor" href="#on-a-server-and-on-several" aria-label="Permalink to &quot;On a server, and on several&quot;">&ZeroWidthSpace;</a></h2>
<p>Passport signs every token with a key pair. On one server it is made the first time an agent connects, in <code>storage/</code>, and there is nothing to do. The pair must outlive a deploy — a new one signs every agent out — so the <a href="https://kitloom.dev/docs/deployment.html#passport-s-keys">deploy kit</a> keeps it on every target: the <code>server</code>, Forge and Ploi targets make it once where <code>storage/</code> lasts, and on Docker, DigitalOcean App Platform and Laravel Cloud, whose disks do not, it lives in the environment:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:passport-keys</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">   # PASSPORT_PRIVATE_KEY="…" and PASSPORT_PUBLIC_KEY="…", for the platform's secrets</span></span></code></pre>
</div><h2 id="keys-stay-for-the-rest" tabindex="-1">Keys stay, for the rest <a class="header-anchor" href="#keys-stay-for-the-rest" aria-label="Permalink to &quot;Keys stay, for the rest&quot;">&ZeroWidthSpace;</a></h2>
<p>A key is still the way for a client that does not sign in, for an agent that may only <strong>read</strong>, and for an automation: <strong>Create a key</strong> on the same page makes one, shows it once, with the settings to paste. A read-only key gets the reading tools only; revoking it stops the agent at once.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/ai/filament/connect-oauth.jpg" src="https://media.kitloom.dev/lessons/ai/filament/connect-oauth.mp4"></video>
  <figcaption>Connect an AI agent to your site: the address, the approval, Connected agents and Revoke</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a> — then <strong>AI agents → Connect an agent</strong>, and paste the address into your own Claude, ChatGPT or Cursor. Every client, the keys and the configuration are in the <a href="https://kitloom.dev/docs/ai.html">AI Agents guide</a>; what an agent does once it is in, in <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Laravel CMS with an MCP server</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>CSV and Excel import in Laravel: products, users and posts, mapped in two steps</title>
      <link>https://kitloom.dev/blog/csv-excel-import-export-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/csv-excel-import-export-in-laravel.html</guid>
      <pubDate>Tue, 27 Oct 2026 12:00:00 GMT</pubDate>
      <description>Load a supplier's price list, a WooCommerce product CSV or a list of users into a Laravel site, and export any of them to CSV, Excel or OpenDocument: columns matched for you, a dry run, a log of every row that did not go in, and an AI agent that does it on request.</description>
      <content:encoded><![CDATA[<p>A supplier sends the new price list as an Excel file every season. The old shop was on WooCommerce, and its product catalogue is a CSV with fifty-odd columns. The members of a club live in another system and have to become users of the site. A hundred posts need a new category, and the quickest way to do it is a spreadsheet. Every site gets files like these, and on a Laravel site the usual answer is a one-off script: it reads the file, maps the columns by hand, and when a row is wrong, it stops halfway with a stack trace, or worse, goes on and writes the wrong thing.</p>
<p>kitloom/spreadsheets is that script, written once, for every record on the site: posts of any type, users, and with the shop, products, orders and order lines. CSV, Excel (XLSX) and OpenDocument (ODS) go in and come out, from the admin, from the console, and from an AI agent.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With kitloom/ai connected, an agent working on the site through MCP takes a file at an address and does the whole thing in words:</p>
<ul>
<li><em>&quot;Load this price list into the products: <code>https://<wbr>files.<wbr>example.<wbr>com/<wbr>autumn.<wbr>csv</code>. Update the ones we already have.&quot;</em></li>
<li><em>&quot;Here is the WooCommerce export of the old shop. Which rows would fail? Don't write anything yet.&quot;</em></li>
<li><em>&quot;Export last month's orders as an Excel file.&quot;</em></li>
</ul>
<p>Three tools do it. <code>sheet_<wbr>preview</code> fetches the file, matches its header row to the sheet's columns and does a dry run: how many rows would be created, updated, skipped or fail, and why, with nothing written. <code>sheet_<wbr>import</code> then runs it, with the agent's own choice of columns where the guess was wrong, and the same switches a person has: <code>update_<wbr>existing</code>, <code>clear_<wbr>empty</code>, <code>dry_<wbr>run</code>. <code>sheet_<wbr>export</code> writes the file and answers with a download link that works for an hour. <code>sheet_<wbr>runs_<wbr>list</code> and <code>sheet_<wbr>run_<wbr>get</code> read the history and the logs, so the agent can tell you <em>&quot;row 14 failed: the column Stock takes a whole number&quot;</em> without you opening the admin.</p>
<p>The agent acts as the user whose key it holds, with that user's permissions: an author's key imports posts and nothing else, a key without the right to give the administrator role cannot give it from a file either. A row never deletes or trashes anything, and every run is in the history under the agent's name. How to connect one: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="importing-in-two-steps" tabindex="-1">Importing in two steps <a class="header-anchor" href="#importing-in-two-steps" aria-label="Permalink to &quot;Importing in two steps&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Spreadsheets → Import</strong> asks two things: what the rows are (a <em>sheet</em>: Posts, Pages, any other post type, Users, Products) and the file. A CSV may need its encoding, when Excel on Windows saved it in the letters of its own language, and its delimiter; left alone, the delimiter is read from the first line.</p>
<p>The file then waits in the <strong>History</strong> for its columns. Every column of the file is shown with its first rows and the column of the sheet it goes into, chosen for you: <code>Regular price</code>, <code>regular_<wbr>price</code> and <code>Regular Price?</code> all land on <em>Regular price</em>, and the names WordPress and WooCommerce use (<code>post_<wbr>title</code>, <code>Short description</code>, <code>Attribute 1 value(s)</code>) match too. A supplier's own <em>Price</em> column is matched by hand in one click; a column you do not want is left at <em>skip</em>. A column the sheet requires has to be chosen before the run can start.</p>
<p>Three switches decide what a row does to a record that is already there:</p>
<ul>
<li><strong>Update existing records.</strong> A row is looked up by its ID, then by what else names it: the slug of a post, the SKU of a product, the email of a user. Off, such a row is skipped and the log says so. On, the record is changed, and only in the columns you mapped.</li>
<li><strong>Empty cells clear values.</strong> Off by default, so an empty cell changes nothing. On, an empty cell in a mapped column empties the value: the sale price of a sale that has ended, the tags of a product, an excerpt. What a record cannot be without (a product's type, an existing user's email) is refused, and the log names the column.</li>
<li><strong>Dry run.</strong> Everything is read and checked, nothing is written; the counts say what would happen. <strong>Preview</strong> does the same on the spot, without leaving the page.</li>
</ul>
<p>The import runs on the queue, so a catalogue of thousands of rows does not keep a browser tab open, and its page in the History fills in as it goes.</p>
<p>A cell holds what the column takes: numbers with a point or a comma, <code>yes</code>/<code>no</code> or <code>1</code>/<code>0</code>, dates in any common form, categories as <code>Travel &gt; Rivers</code> with a child under its parent, a featured image as an address the site fetches into the media library, custom fields as <code>field:<wbr>isbn</code>, other meta as <code>meta:<wbr>shelf</code>. Users never carry a password in either direction: a new user gets an email inviting them to choose one. The easiest way to get the columns right is to export a few records first and use that file as the template.</p>
<h2 id="when-a-row-is-wrong" tabindex="-1">When a row is wrong <a class="header-anchor" href="#when-a-row-is-wrong" aria-label="Permalink to &quot;When a row is wrong&quot;">&ZeroWidthSpace;</a></h2>
<p>A row that cannot go in, a price that is not a number, a status that does not exist, a role you may not give, <strong>fails on its own</strong>: nothing of it is written, the log says why, and the other rows go in. The History shows the run with <em>3 rows: 2 created, 0 updated, 0 skipped, 1 failed</em> and, under it, <em>Row 3: The column &quot;Regular price&quot; takes a number.</em> Fix the cell and import the file again with <strong>Update existing records</strong> on: the rows that went in the first time are found and left as they are, the fixed one goes in. Nothing is imported twice.</p>
<h2 id="exporting" tabindex="-1">Exporting <a class="header-anchor" href="#exporting" aria-label="Permalink to &quot;Exporting&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Spreadsheets → Export</strong> takes a sheet, its filters (a status, a date range, a category, a role, a product type) and a format, and the file downloads. The first row names the columns the way Import reads them back, so an exported file can be edited in Excel and imported again unchanged. Products come out in WooCommerce's own columns, so the file also goes into a WooCommerce shop as it is, and a WooCommerce export comes in the same way. Orders and their lines are export only: one row per order, or one per line with the SKU and the quantity, for the accountant or the warehouse.</p>
<p>Every export is written down in the History too, with its filters, and keeps its file for a day.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>A module adds a sheet with a <code>Kitloom\<wbr>Spreadsheets\<wbr>Contracts\<wbr>Sheet</code> tagged <code>Sheet::<wbr>TAG</code>: its key, label, permissions, columns, filters, and how it finds and writes a row through the site's writers, as the acting user. That is all the shop did for products, orders and order lines; a sheet with the key of a built-in one replaces it. The console has the same three steps: <code>kitloom:<wbr>sheets</code> lists the sheets and their columns, <code>kitloom:<wbr>sheet-<wbr>import</code> and <code>kitloom:<wbr>sheet-<wbr>export</code> take a file, with <code>--<wbr>map</code>, <code>--<wbr>update</code>, <code>--<wbr>clear-<wbr>empty</code>, <code>--<wbr>dry-<wbr>run</code> and <code>--<wbr>as=user</code>. Files are read and written with <a href="https://github.com/openspout/openspout" target="_blank" rel="noreferrer">OpenSpout</a>, row by row, so a large file does not need a large server.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>Three short lessons from the admin, narrated:</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/spreadsheets/filament/import.jpg" src="https://media.kitloom.dev/lessons/spreadsheets/filament/import.mp4"></video>
  <figcaption>Import a spreadsheet: a supplier's price list, the columns mapped, a dry run, then the run with existing products updated</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/spreadsheets/filament/export.jpg" src="https://media.kitloom.dev/lessons/spreadsheets/filament/export.mp4"></video>
  <figcaption>Export a spreadsheet: the products of one category as a CSV file</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/spreadsheets/filament/history.jpg" src="https://media.kitloom.dev/lessons/spreadsheets/filament/history.mp4"></video>
  <figcaption>History: how a run ended, the rows that did not go in and why, an export's file downloaded again</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. What every column takes, the commands and the agent tools are in the <a href="https://kitloom.dev/docs/modules/guides/spreadsheets.html">Spreadsheets guide</a>. A shop that moves from WooCommerce brings its catalogue with it without a file at all: <a href="https://kitloom.dev/blog/woocommerce-to-laravel.html">Migrate WooCommerce to Laravel</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Laravel multisite: several sites in one application, a database per site</title>
      <link>https://kitloom.dev/blog/laravel-multisite-one-application-many-sites.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/laravel-multisite-one-application-many-sites.html</guid>
      <pubDate>Tue, 27 Oct 2026 12:00:00 GMT</pubDate>
      <description>Run a network of sites from one Laravel application, as WordPress Multisite does: a site per domain with its own database, content, users and theme, added from the admin in a minute — kitloom/multisite.</description>
      <content:encoded><![CDATA[<p>An agency keeps eleven client sites on the same stack. A publisher runs a magazine, its events site and a shop. A school has a site per campus. Each wants its own domain, its own content and its own administrator, and nobody wants eleven deploys, eleven update rounds and eleven sets of credentials to look after.</p>
<p>WordPress answers this with Multisite: one install, a network of sites, each with its own tables, users, theme and plugins switched on. On Laravel the usual answers are a multi-tenancy package, which is built for a SaaS and its sign-up flow, or a copy of the application per site, which is the eleven deploys again.</p>
<p>kitloom/multisite is the WordPress answer on Laravel: <strong>one application, one deploy, a site per domain</strong> — with its own database, content, users, theme and modules, managed from the main site's admin.</p>
<h2 id="how-a-site-is-chosen" tabindex="-1">How a site is chosen <a class="header-anchor" href="#how-a-site-is-chosen" aria-label="Permalink to &quot;How a site is chosen&quot;">&ZeroWidthSpace;</a></h2>
<p>The site your <code>.<wbr>env</code> describes is the main site. The others are rows of a <code>sites</code> table in its database. A row names the hosts the site answers — the first is its address, the others redirect to it — and where its data is:</p>
<ul>
<li><strong>A SQLite file of its own</strong>, in <code>storage/<wbr>sites/<wbr>&lt;name&gt;/</code>. Nothing to set up; enough for a small site on a server with a disk.</li>
<li><strong>A MySQL database of its own</strong>: a database and a user you made on the server.</li>
<li><strong>The main database, with a table prefix of its own</strong> — the way a WordPress network keeps its sites: <code>shop_<wbr>posts</code> beside <code>wp_<wbr>posts</code>.</li>
</ul>
<p>On every request the host picks the row, before anything else runs. The application then points its database connection, its uploads folder, its address and its cache namespace at the site and boots as it always does: the active theme, the switched-on modules and every setting come from <em>that</em> database. A site cannot see its neighbours; the main site is the only place the network is managed from.</p>
<p>Nothing of the application is copied per site. The code, the installed modules and themes, the built assets, Redis and the queue are shared; what a site has of its own is its database and its files.</p>
<h2 id="adding-a-site" tabindex="-1">Adding a site <a class="header-anchor" href="#adding-a-site" aria-label="Permalink to &quot;Adding a site&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Sites → New Site</strong> in Filament, or <strong>Sites → Create Site</strong> in Nova: the name, the hosts, the database. Leave <em>Set the database up now</em> ticked and name the administrator: the migrations run, WordPress's options and roles are written, the administrator is made with their role, and the password is shown once. The site answers as soon as the DNS and the web server point the domain at the application.</p>
<p>The same from the console:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> multisite:create</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> shop</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> shop.example.com</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> www.shop.example.com</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --email=owner@example.com</span></span></code></pre>
</div><p>Every artisan command runs on a site with <code>--<wbr>site=&lt;name&gt;</code> — <code>migrate --<wbr>site=shop</code>, <code>queue:<wbr>work --<wbr>site=shop</code> — and <code>multisite:<wbr>run all &quot;migrate --<wbr>force&quot;</code> runs one on the main site and every site, a process each. One cron line, <code>schedule:<wbr>run</code> on the main site, runs every site's schedule; queued jobs carry the site that queued them and the worker switches onto it.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/multisite/filament/sites.jpg" src="https://media.kitloom.dev/lessons/multisite/filament/sites.mp4"></video>
  <figcaption>A second site added from the admin: its domain, its database, its administrator — answering a minute later</figcaption>
</figure>
</div>
<h2 id="what-to-know-before" tabindex="-1">What to know before <a class="header-anchor" href="#what-to-know-before" aria-label="Permalink to &quot;What to know before&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>Users are per site.</strong> An account on one site is not an account on another. A WordPress network shares users across its sites; a network moved here gets its users copied into each site.</li>
<li><strong>The main site's migrations are what a new site gets.</strong> Keep every module on while sites are made, or run <code>migrate --<wbr>site=&lt;name&gt;</code> after switching one on.</li>
<li><strong>Laravel Nova checks its licence against the request's domain.</strong> Ask Laravel about a licence for the network's domains before running Nova sites this way. Filament has no such check.</li>
<li><strong>Deleting a site takes it off the list.</strong> Its database and files stay where they are; <em>Pause</em> keeps it on the list and shows its visitors a page saying it is paused.</li>
</ul>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail of the module is in the <a href="https://kitloom.dev/docs/modules/guides/multisite.html">Multisite guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Let shoppers' AI assistants shop your store, with a public MCP server</title>
      <link>https://kitloom.dev/blog/shoppers-ai-assistants.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/shoppers-ai-assistants.html</guid>
      <pubDate>Tue, 27 Oct 2026 12:00:00 GMT</pubDate>
      <description>A public MCP address for a Laravel shop: shoppers' own Claude or ChatGPT search your live catalogue and hand them a signed link that fills a cart on your site. Read-only, no sign-in.</description>
      <content:encoded><![CDATA[<p>More and more shoppers start with a question to an AI assistant, not with a search box: <em>&quot;a gift box for my sister, she loves nuts and dried fruit, under $30&quot;</em>. The assistant answers from what it can find — a search engine's snippets, a crawl from last month, a marketplace listing — and the shopper ends up somewhere else, or on your site with a price that changed and a size that sold out.</p>
<p>kitloom shops can now answer those assistants themselves. The new <strong>Public AI Agents</strong> module opens an <a href="https://modelcontextprotocol.io" target="_blank" rel="noreferrer">MCP</a> address on your site, <code>/<wbr>mcp/<wbr>public</code>. A shopper adds it to their assistant once; from then on the assistant asks <em>your</em> catalogue, in <em>your</em> categories and sizes, at today's prices and stock — and when the shopper has chosen, it hands them a link that fills a cart on your site. The checkout stays yours.</p>
<figure>
  <img src="https://kitloom.dev/blog/shoppers-ai-assistants/cart.jpg" width="1440" height="900" alt="On the left, a shopper's AI assistant connected to localhost:8093/mcp/public: it searched the shop's gift sets, recommended the Fruit & Nut Box at $24, then added a 500 g bag of Mixed Nuts and gave a cart link. On the right, the shop's cart page with both products and the notice '2 products your assistant chose are in your cart'." loading="lazy">
  <figcaption>The shopper's assistant on the left, your site on the right: the link it handed over opened the cart with both products in it.</figcaption>
</figure>
<h2 id="two-doors-two-kinds-of-agent" tabindex="-1">Two doors, two kinds of agent <a class="header-anchor" href="#two-doors-two-kinds-of-agent" aria-label="Permalink to &quot;Two doors, two kinds of agent&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom already had a door for AI agents: <code>/<wbr>mcp</code>, where Claude, Cursor or your own agent runs the site — writes posts, fixes redirects, moves orders on — with the rights of the user whose key it holds. That door is for you and your staff.</p>
<p>The new one is for everybody else, and it is built the other way round:</p>
<table tabindex="0">
<thead>
<tr>
<th></th>
<th>Your agents (<code>kitloom/<wbr>ai</code>)</th>
<th>Shoppers' assistants (<code>kitloom/<wbr>public-<wbr>agents</code>)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Address</td>
<td><code>/<wbr>mcp</code></td>
<td><code>/<wbr>mcp/<wbr>public</code></td>
</tr>
<tr>
<td>Who</td>
<td>you and your staff</td>
<td>any visitor</td>
</tr>
<tr>
<td>Key</td>
<td>an application password per user</td>
<td>none, no sign-in</td>
</tr>
<tr>
<td>Sees</td>
<td>what that user may see</td>
<td>what any visitor sees</td>
</tr>
<tr>
<td>Writes</td>
<td>through the admin's writers, as that user</td>
<td>nothing</td>
</tr>
<tr>
<td>Tools</td>
<td>content, media, settings, every module's</td>
<td>the shop's catalogue and a cart link</td>
</tr>
</tbody>
</table>
<p>Nothing crosses between them. A public tool has no user to act as, so there is nothing to sign in as and nothing to escalate to.</p>
<h2 id="what-the-assistant-can-do" tabindex="-1">What the assistant can do <a class="header-anchor" href="#what-the-assistant-can-do" aria-label="Permalink to &quot;What the assistant can do&quot;">&ZeroWidthSpace;</a></h2>
<p>With the Shop installed, the public address serves four tools:</p>
<ul>
<li><strong><code>catalog_<wbr>vocabulary</code></strong> — the shop's own words: the category tree with how many products each holds, the attributes (weight, size, colour…) with every value, the price range, the currency. The assistant calls it first and turns &quot;something for a tea lover, not too big&quot; into your categories and values instead of guessing.</li>
<li><strong><code>search_<wbr>products</code></strong> — keywords and the shop's own filters: a category with its subcategories, attribute values, a price range, on sale, in stock, a minimal rating, a sort order. Products that have every word come first; when none has them all, those with any, and the answer says which.</li>
<li><strong><code>product_<wbr>details</code></strong> — one product as a shopper reads it on its page: descriptions, categories, tags, attributes, and for a variable product every variation the shopper can pick, with its price and stock. The rating and the number of reviews — never the reviews' text.</li>
<li><strong><code>cart_<wbr>link</code></strong> — up to 20 products with their quantities and variations, turned into a link to your site.</li>
</ul>
<p>The catalogue is read with the same query your shop pages use: published products only, not hidden from the catalogue, out-of-stock ones as your <em>Hide out of stock items</em> setting says. Drafts, private products, orders, customers and coupons never leave through this address.</p>
<h2 id="the-cart-link" tabindex="-1">The cart link <a class="header-anchor" href="#the-cart-link" aria-label="Permalink to &quot;The cart link&quot;">&ZeroWidthSpace;</a></h2>
<p>The assistant never orders and never pays. What it gives the shopper is an address on your site:</p>
<div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span>https://your-shop.com/wp-json/wc/store/v1/cart/link?items=75:1,38:1:41&#x26;expires=…&#x26;signature=…</span></span></code></pre>
</div><p>It is signed by your application key and works for 24 hours, so a link edited by hand — another product, a quantity of 40 — is refused. Opening it puts the products into the shopper's own cart and shows the cart page, with a notice that their assistant chose them. Something that sold out in between is said there; the rest is added.</p>
<p>From that moment it is your shop as usual: your shipping rates, your coupons, your payment methods, your checkout fields. The e-commerce events your analytics and ad pixels listen to — <code>add_<wbr>to_<wbr>cart</code>, <code>begin_<wbr>checkout</code>, <code>purchase</code> — fire as for any other visitor.</p>
<h2 id="one-switch-for-the-owner" tabindex="-1">One switch for the owner <a class="header-anchor" href="#one-switch-for-the-owner" aria-label="Permalink to &quot;One switch for the owner&quot;">&ZeroWidthSpace;</a></h2>
<p>The address is closed until you open it. <strong>Public AI Agents → Settings</strong>, in either admin:</p>
<figure>
  <img src="https://kitloom.dev/blog/shoppers-ai-assistants/settings.jpg" width="1440" height="900" alt="Public AI Agents Settings in the Filament admin: the switch Open the public address turned on, the address http://localhost:8093/mcp/public, Requests a minute per visitor set to 60, and What it serves listing catalog_vocabulary, search_products, product_details and cart_link from kitloom/shop." loading="lazy">
  <figcaption>The switch, the address to give out, a limit per visitor, and the tools the installed modules offer.</figcaption>
</figure>
<ul>
<li><strong>Open the public address.</strong> Off, the address answers 404.</li>
<li><strong>Address</strong> — the URL to put where shoppers look for it: the footer, the help page, an &quot;Ask your AI assistant&quot; note on the shop page.</li>
<li><strong>Requests a minute per visitor</strong> — 60 by default. An assistant makes a few requests per question; past the limit one visitor's address waits for the rest of the minute. Cart links have a limit of their own.</li>
</ul>
<p>Only administrators have the page (<code>manage_<wbr>public_<wbr>agents</code>). Your own AI agents cannot open or close the address: its settings are on the list of settings agents may read but never change, with the other doors into the site.</p>
<h2 id="how-a-shopper-connects" tabindex="-1">How a shopper connects <a class="header-anchor" href="#how-a-shopper-connects" aria-label="Permalink to &quot;How a shopper connects&quot;">&ZeroWidthSpace;</a></h2>
<p>The assistant needs the address and nothing else:</p>
<ul>
<li><strong>Claude</strong> (claude.ai, the desktop and phone apps): Settings → Connectors → <em>Add custom connector</em>, the URL <code>https://<wbr>your-<wbr>shop.<wbr>com/<wbr>mcp/<wbr>public</code>, no authentication.</li>
<li><strong>Claude Code, Cursor, VS Code</strong> and other MCP clients: a remote HTTP server at the same URL, for example <code>claude mcp add --<wbr>transport http your-<wbr>shop https://<wbr>your-<wbr>shop.<wbr>com/<wbr>mcp/<wbr>public</code>.</li>
<li><strong>Any other assistant</strong> that can add a remote MCP server, the same way.</li>
</ul>
<p>The server introduces itself with your site's name and tells the assistant how to use it: the vocabulary first, then search, then details, and a cart link at the end — and that nothing here signs in, orders or pays.</p>
<h2 id="what-it-is-not" tabindex="-1">What it is not <a class="header-anchor" href="#what-it-is-not" aria-label="Permalink to &quot;What it is not&quot;">&ZeroWidthSpace;</a></h2>
<p>It is not a feed for a marketplace and not a chatbot on your pages. You do not pay for anybody's model: the shopper's assistant runs on the shopper's account, and your site answers it as it answers a browser, with a few small JSON responses. It does not know who is asking, so there is no customer data to protect in it — and none to leak.</p>
<h2 id="for-developers-a-tool-of-your-own" tabindex="-1">For developers: a tool of your own <a class="header-anchor" href="#for-developers-a-tool-of-your-own" aria-label="Permalink to &quot;For developers: a tool of your own&quot;">&ZeroWidthSpace;</a></h2>
<p>Any module can offer tools at the public address. A tool is a <code>Public<wbr>Agent<wbr>Tool</code> tagged in the module's provider — the agent tool contract without a user, a permission and writes:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Kitloom\WpSchema\Contracts\PublicAgentTool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">final</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> readonly</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> class</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> OpeningHours</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> implements</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> PublicAgentTool</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'opening_hours'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">; }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> module</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'acme/stores'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">; }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> description</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> string</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'The opening hours of every store, this week.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> schema</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">JsonSchema</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $schema)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> []; }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> handle</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $arguments)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> app</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">StoreHours</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">thisWeek</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">$this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">app</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">tag</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">([</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">OpeningHours</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">], </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">PublicAgentTool</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">TAG</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span></code></pre>
</div><p>It reads what any visitor may see — outside the admin, kitloom's visibility scopes already see to that — and writes nothing. The module does not require Public AI Agents: without it nothing reads the tag.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>A two-minute lesson: the owner opens the address, then a shopper's assistant finds a gift and fills the cart.</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/public-agents/filament/shoppers.jpg" src="https://media.kitloom.dev/lessons/public-agents/filament/shoppers.mp4"></video>
  <figcaption>Let AI shopping assistants shop your store: the address opened, a gift found, the cart filled</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a> — a Pantry store, where <strong>Public AI Agents → Settings</strong> opens the address for your own assistant. Every detail of the module is in the <a href="https://kitloom.dev/docs/modules/guides/public-agents.html">Public AI Agents guide</a>; your own agents, which run the site with a key, are on <a href="https://kitloom.dev/docs/ai.html">AI Agents</a>, and public tools for your own modules in <a href="https://kitloom.dev/docs/modules/extending.html#tools-for-visitors-assistants">Extension Points</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>A Next.js storefront on a Laravel CMS, with React Server Components</title>
      <link>https://kitloom.dev/blog/nextjs-storefront-on-laravel-cms.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/nextjs-storefront-on-laravel-cms.html</guid>
      <pubDate>Mon, 26 Oct 2026 12:00:00 GMT</pubDate>
      <description>For Next.js developers: a catch-all Server Component that reads any page of a kitloom site as JSON, generateMetadata from the site's SEO head, a 404 that stays a 404, and the shop's cart, checkout, account, comments and reviews through Route Handlers and router.refresh() — no API client, no CORS. An AI agent fills the catalog while you write the templates.</description>
      <content:encoded><![CDATA[<p>You write Next.js. A client wants a shop with a blog, reviews, an admin their editors can use, and pages that rank. The usual stack is a headless CMS for the words, a commerce API for the shop, an auth provider for the account, and your app in the middle translating between three shapes of data. Server Components made the rendering easy; the glue is still most of the work.</p>
<p>This post builds a Next.js storefront on kitloom, a Laravel CMS, where the glue is one function. Every address of the site answers with JSON that already says which template it is and carries everything the page needs — the record, the menus, the widgets, the <code>&lt;head&gt;</code>, the catalog, the product, the visitor's cart. A Server Component reads it and draws it. The theme is called Mesa, it is in desert colours — sand, terracotta, the sun, a dusk-blue sky for the dark mode — and it is the sibling of <a href="https://kitloom.dev/blog/nuxt-storefront-on-laravel-cms.html">Harvest</a>, the same storefront in Nuxt.</p>
<h2 id="the-catalog-is-not-your-job" tabindex="-1">The catalog is not your job <a class="header-anchor" href="#the-catalog-is-not-your-job" aria-label="Permalink to &quot;The catalog is not your job&quot;">&ZeroWidthSpace;</a></h2>
<p>Before the templates: who fills the shop? With kitloom/ai an AI agent connects to the site over MCP and works through the same code as the admin, as the user whose key it holds:</p>
<ul>
<li><em>&quot;Add sixteen products in three categories with prices, weights and a photo each.&quot;</em></li>
<li><em>&quot;Write the About, Delivery and Contact pages and put them in the header menu.&quot;</em></li>
<li><em>&quot;Answer this week's comments and approve the ones waiting.&quot;</em></li>
</ul>
<p><code>product_<wbr>save</code>, <code>create_<wbr>content</code>, <code>menu_<wbr>save</code>, <code>comments_<wbr>reply</code> — every module brings its tools, nothing is deleted for good, every change lands in the activity log, and revoking the key stops the agent at once. So the store you build against is a real one from the first day. <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a> shows the setup.</p>
<h2 id="one-route-read-on-the-server" tabindex="-1">One route, read on the server <a class="header-anchor" href="#one-route-read-on-the-server" aria-label="Permalink to &quot;One route, read on the server&quot;">&ZeroWidthSpace;</a></h2>
<p>The whole site is one page, <code>app/<wbr>[[...<wbr>slug]]/<wbr>page.<wbr>tsx</code>. It reads the address from the site with the visitor's cookies and lets the site decide what the address is:</p>
<div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> default</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> SitePage</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">props</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> Props</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">path</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">page</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> load</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(props)        </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// GET &#x3C;site>&#x3C;path>, Accept: application/json</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">page) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">throw</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> Error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'The site could not be read.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (page.kind </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">===</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'not-found'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">notFound</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Template</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> resolveTemplate</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(page)           </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// front-page, single, archive, catalog, product…</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    &#x3C;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Shell</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> page</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{page} </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">path</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{path}></span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">      &#x3C;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">script</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> type</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"application/ld+json"</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> dangerouslySetInnerHTML</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{{ __html: </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">jsonLd</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(page.schema) }} /></span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">      &#x3C;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Template</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> page</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{page} </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">path</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{path} /></span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    &#x3C;/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Shell</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">  )</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p><code>resolve<wbr>Template</code> is WordPress's template hierarchy decided by the server: a page with a <code>product</code> part is the product template, one with a <code>catalog</code> the catalog, the shop's cart, checkout and account pages are known by their shortcodes, and the rest goes by the <code>template</code> the site sent — <code>front-<wbr>page</code>, <code>single</code>, <code>archive</code>, <code>search</code>. The JSON is the same one a Vue or React theme on the site itself reads; <a href="https://kitloom.dev/docs/headless.html">the headless page</a> lists its parts.</p>
<p>The read sits under React's <code>cache()</code>, so <code>generate<wbr>Metadata</code> and the page share one request to the site:</p>
<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> getPage</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> cache</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">async</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">path</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> siteFetch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">Page</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">>(path)).data)</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> generateMetadata</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">props</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> Props</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">Metadata</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> metadataOf</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">((</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> load</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(props)).page)      </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// the site's SEO head, on the theme's origin</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>The title, the description, the robots, the canonical, the <code>hreflang</code> alternates and the Open Graph card come from the site's SEO module; the theme only moves the addresses onto its own domain. There is no second source of truth for SEO to keep in step.</p>
<h2 id="a-404-that-is-a-404" tabindex="-1">A 404 that is a 404 <a class="header-anchor" href="#a-404-that-is-a-404" aria-label="Permalink to &quot;A 404 that is a 404&quot;">&ZeroWidthSpace;</a></h2>
<p>An address the site does not have comes back with <code>&quot;kind&quot;:<wbr> &quot;not-<wbr>found&quot;</code>. The page calls <code>not<wbr>Found()</code>, and Next answers with a real 404 status. The not-found boundary gets no route params, though, and it has to draw the site's header and footer too. So <code>proxy.<wbr>ts</code> — Next 16's name for middleware — hands the address to the render as a request header, and <code>app/<wbr>not-<wbr>found.<wbr>tsx</code> reads the page from the same cache:</p>
<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> proxy</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> NextRequest</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> forwarded</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> Headers</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(request.headers)</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">  forwarded.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">set</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'x-theme-path'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, request.nextUrl.pathname </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">+</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> request.nextUrl.search)</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> NextResponse.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">next</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">({ request: { headers: forwarded } })</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>The same proxy adds the trailing slash to the site's addresses, as WordPress does — <code>/<wbr>shop</code> goes to <code>/<wbr>shop/</code> — while the theme's own routes under <code>/<wbr>api</code> keep theirs without one.</p>
<h2 id="the-cart-is-the-site-s-the-session-is-yours" tabindex="-1">The cart is the site's, the session is yours <a class="header-anchor" href="#the-cart-is-the-site-s-the-session-is-yours" aria-label="Permalink to &quot;The cart is the site's, the session is yours&quot;">&ZeroWidthSpace;</a></h2>
<p>The cart, the checkout, the account, the comments and the reviews are not rebuilt in the theme. They are the site's, through its Store API — <code>cart/<wbr>add-<wbr>item</code>, <code>update-<wbr>items</code>, <code>checkout</code>, <code>account/<wbr>register</code> — and its sign-in and comment routes. What Next adds is the visitor's session. A Server Component may read cookies but not set them, so every change goes through a Route Handler, which keeps the cookies the site gave the visitor in one <code>http<wbr>Only</code> cookie of the theme and names the site as the <code>Origin</code>, so the site's forgery check passes as for its own forms:</p>
<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// app/api/cart/add/route.ts</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> POST</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> Request</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">product_id</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">quantity</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> request.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">json</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> answer</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> siteFetch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/wp-json/wc/store/v1/cart/add-item'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    method: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'POST'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, keep: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, body: { product_id, quantity },</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">  }))</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>The button is a Client Component that calls the route and then asks the server to draw the page again:</p>
<div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> add</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> async</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> result</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> api</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/api/cart/add'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, { product_id: product.id, quantity })</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">  notify</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(result.message)</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (result.ok) router.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">refresh</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()                  </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// the header's count is the site's again</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>No cart store in the browser, nothing to keep in sync: after every change the header, the cart page and the checkout are drawn from what the site says now. The checkout form itself comes from the site's checkout page — its fields with their labels and which are required, the countries it sells and ships to, the states of each, the delivery rates and the payment methods. &quot;Place order&quot; answers either where to go next or a message per field; the receipt and every view of the account are pages of the site, drawn by the theme. A comment or a review carries the site's spam protection, the honeypot and Cloudflare Turnstile, and lands held or published, as the site decides.</p>
<h2 id="three-things-next-16-changes" tabindex="-1">Three things Next 16 changes <a class="header-anchor" href="#three-things-next-16-changes" aria-label="Permalink to &quot;Three things Next 16 changes&quot;">&ZeroWidthSpace;</a></h2>
<p>The Next.js in this theme is not the one in most tutorials, and the package says so: it ships its documentation in <code>node_<wbr>modules/<wbr>next/<wbr>dist/<wbr>docs</code> and asks you to read it first. Three of its changes shaped the theme.</p>
<ul>
<li><strong>Middleware is Proxy.</strong> Same idea, new file name, and <code>skip<wbr>Trailing<wbr>Slash<wbr>Redirect</code> lets it decide where the trailing slash goes.</li>
<li><strong>Cache Components are off.</strong> With them Next keeps the last pages alive under React's <code>&lt;Activity&gt;</code> instead of unmounting them. For a page that belongs to the visitor — their cart, signed in or not — a page kept from before is the bug, not the feature. Every page here is dynamic and drawn fresh.</li>
<li><strong>The header lives in the page, not the layout.</strong> A layout stays from one page to the next. The menus change with the language, the cart count with every order, the account icon with signing in, so the frame is drawn with the page it belongs to.</li>
</ul>
<h2 id="one-contract-two-frameworks" tabindex="-1">One contract, two frameworks <a class="header-anchor" href="#one-contract-two-frameworks" aria-label="Permalink to &quot;One contract, two frameworks&quot;">&ZeroWidthSpace;</a></h2>
<p>Mesa answers the same routes of its own as Harvest does: <code>/<wbr>api/<wbr>page</code>, <code>/<wbr>api/<wbr>cart/<wbr>add</code>, <code>/<wbr>api/<wbr>checkout</code>, <code>/<wbr>api/<wbr>account/<wbr>login</code>, <code>/<wbr>api/<wbr>comments</code>. So one script checks both. <code>npm run regression</code> walks what a visitor does over HTTP — every kind of page drawn on the server with its head and links, a guest's cart and order, an account signed up, out and in, an order as the customer and the account after it, a comment, a reply and a review — and it passes the same 42 checks on Nuxt and on Next.js. The site never knew which one it was talking to.</p>
<p>The theme is on GitHub: <a href="https://github.com/kitloom/mesa-theme" target="_blank" rel="noreferrer">kitloom/mesa-theme</a>. Point <code>NEXT_<wbr>PUBLIC_<wbr>SITE_<wbr>URL</code> at a kitloom site, run <code>npm run dev</code>, and it draws it. The README says what to switch on in the admin for guests to order.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>A sandbox is a site of your own for three days, with demo content and the admin, no sign-up: <a href="https://filament.kitloom.dev/pantry" target="_blank" rel="noreferrer">Pantry</a>, the nuts-and-dried-fruit shop both themes were built against. Put its address into the theme's <code>.<wbr>env</code> and the storefront is yours to change.</p>
<p>kitloom is a paid product — <a href="https://kitloom.dev/services.html#license">US$299 for one site</a>, or a site we build for you — and the <a href="https://kitloom.dev/docs/introduction.html">documentation</a> is open to everyone.</p>
]]></content:encoded>
    </item>
    <item>
      <title>A Nuxt storefront on a Laravel CMS, without writing the API</title>
      <link>https://kitloom.dev/blog/nuxt-storefront-on-laravel-cms.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/nuxt-storefront-on-laravel-cms.html</guid>
      <pubDate>Mon, 26 Oct 2026 12:00:00 GMT</pubDate>
      <description>For Nuxt developers: one catch-all route, a server route that reads any page of a kitloom site as JSON, and the shop's cart, checkout and account through the site's own Store API — no REST client, no GraphQL layer, no CORS. The content and the catalog are filled by an AI agent while you write the templates.</description>
      <content:encoded><![CDATA[<p>You write Nuxt. A client wants a shop with a blog, an admin their editors can use, and pages that rank. The usual answer is a headless CMS and your own app: an API to learn, a client to write, a shape for every kind of page, a render layer, and the cart somewhere else again. By the time the first product page is up, most of the work was glue.</p>
<p>This post builds a Nuxt storefront on kitloom, a Laravel CMS, and the glue is one server route. Every address of the site comes back as JSON with everything its own templates get — the record, the menus, the widgets, the <code>&lt;head&gt;</code>, the catalog, the product, the cart. The site says which template the address is; Nuxt draws it. The theme is called Harvest, it is in autumn colours, and the whole of it is a few hundred lines.</p>
<h2 id="the-content-is-somebody-else-s-job" tabindex="-1">The content is somebody else's job <a class="header-anchor" href="#the-content-is-somebody-else-s-job" aria-label="Permalink to &quot;The content is somebody else's job&quot;">&ZeroWidthSpace;</a></h2>
<p>Before the templates: who fills the shop? With kitloom/ai an agent connects to the site over MCP and works through the same code as the admin, as the user whose key it holds. Hand it the brief:</p>
<ul>
<li><em>&quot;Create the About, Delivery and Contact pages and put them in the header menu.&quot;</em></li>
<li><em>&quot;Add sixteen products in three categories with prices, weights and a photo each.&quot;</em></li>
<li><em>&quot;Write five posts for the journal, each with a cover and an excerpt.&quot;</em></li>
</ul>
<p><code>create_<wbr>content</code>, <code>product_<wbr>save</code>, <code>menu_<wbr>save</code>, <code>upload_<wbr>media</code> — each module brings its tools, nothing is deleted for good, every change is in the activity log, and revoking the key stops the agent at once. So while you build the storefront, the catalog you build against is real. <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a> shows the setup.</p>
<h2 id="every-page-is-json-already" tabindex="-1">Every page is JSON already <a class="header-anchor" href="#every-page-is-json-already" aria-label="Permalink to &quot;Every page is JSON already&quot;">&ZeroWidthSpace;</a></h2>
<p>A kitloom site answers any address it serves with JSON when asked for it:</p>
<div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span>GET https://shop.example.com/product/walnut-halves-250-g/</span></span>
<span class="line"><span>Accept: application/json</span></span>
<span class="line"><span></span></span>
<span class="line"><span>{</span></span>
<span class="line"><span>  "kind": "single",</span></span>
<span class="line"><span>  "template": "single-product",</span></span>
<span class="line"><span>  "content": { "title": "Walnut Halves, 250 g", "content": "&#x3C;p>…&#x3C;/p>", … },</span></span>
<span class="line"><span>  "product": { "priceFormatted": "$6.40", "onSale": true, "gallery": […], "reviews": {…}, … },</span></span>
<span class="line"><span>  "menus": {…}, "menuLocations": {…}, "widgets": {…},</span></span>
<span class="line"><span>  "head": { "title": "…", "description": "…", "canonical": "…", "openGraph": {…} },</span></span>
<span class="line"><span>  "schema": { "@context": "https://schema.org", … },</span></span>
<span class="line"><span>  "languages": {…}, "cart": { "count": 0, … }</span></span>
<span class="line"><span>}</span></span></code></pre>
</div><p>An archive carries its <code>posts</code> with pagination, the shop page its <code>catalog</code> with the categories, the sort orders and the filters, a post its <code>comments</code>, the front page the data of each shortcode the owner put on it. The same JSON a Vue or React theme on the site itself reads — <a href="https://kitloom.dev/docs/headless.html">the headless page</a> lists the parts. So the Nuxt app needs no API client, no types guessed from a REST reference, and no second source of truth for the SEO: the title, the description, the canonical, the Open Graph card and the JSON-LD were computed by the site's SEO module, and the theme puts them into <code>use<wbr>Seo<wbr>Meta</code>.</p>
<h2 id="one-route-one-server-route" tabindex="-1">One route, one server route <a class="header-anchor" href="#one-route-one-server-route" aria-label="Permalink to &quot;One route, one server route&quot;">&ZeroWidthSpace;</a></h2>
<p>The theme has one page, <code>app/<wbr>pages/<wbr>[...<wbr>slug].<wbr>vue</code>, and one server route that reads the site:</p>
<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// server/api/page.get.ts</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> defineEventHandler</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">async</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">event</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> path</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> String</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getQuery</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(event).path </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">??</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> '/'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> response</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> siteFetch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">Page</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">>(event, path)   </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// GET &#x3C;site>&#x3C;path>, Accept: application/json</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">  setResponseStatus</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(event, response.status)              </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// a 404 of the site is a 404 of the theme</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> response._data</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">})</span></span></code></pre>
</div><p>A global route middleware reads the page once per address with <code>use<wbr>Async<wbr>Data</code> and shares it with the layout, so the header and the footer draw the menus and the widgets the page came with — on the server as on the client, no flash:</p>
<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// app/middleware/page.global.ts</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> defineNuxtRouteMiddleware</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">async</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">to</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> request</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> useRequestFetch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">data</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> useAsyncData</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">Page</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">>(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">`page:${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">to</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">fullPath</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">}`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=></span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">    request</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'/api/page'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, { query: { path: to.fullPath }, ignoreResponseError: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> }))</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">  useSharedPage</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">().value </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> data.value</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">})</span></span></code></pre>
</div><p>The page picks its template from what the site said — WordPress's template hierarchy, decided by the server, drawn by Nuxt:</p>
<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> resolveTemplate</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">page</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> Page</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> Component</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (page.kind </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">===</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'not-found'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> NotFound</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (page.product) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> SingleProduct</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (page.catalog) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> Catalog</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">shortcode</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(page, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'woocommerce_cart'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> Cart</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">shortcode</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(page, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'woocommerce_checkout'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> Checkout</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">shortcode</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(page, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'woocommerce_my_account'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> Account</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (page.template </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">===</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'front-page'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> FrontPage</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (page.posts) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> Archive</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> Single</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>Links in the site's answers are absolute — to the site. A small composable turns them into the theme's own paths, and HTML written in the admin gets the same treatment, with a click on an inner link navigating without a reload. The French version of the site (<code>/<wbr>fr/<wbr>…</code>) works the moment the languages module is on: the page comes back in French, the menus too, and the theme never knew.</p>
<h2 id="the-cart-is-the-site-s-the-session-is-yours" tabindex="-1">The cart is the site's, the session is yours <a class="header-anchor" href="#the-cart-is-the-site-s-the-session-is-yours" aria-label="Permalink to &quot;The cart is the site's, the session is yours&quot;">&ZeroWidthSpace;</a></h2>
<p>The cart, the checkout and the account are not a second shop. They are the site's, through its Store API — the same routes WooCommerce's blocks use, <code>wc/<wbr>store/<wbr>v1/<wbr>cart/<wbr>add-<wbr>item</code>, <code>update-<wbr>items</code>, <code>checkout</code>, <code>account/<wbr>register</code> — and through the site's <code>POST /<wbr>login</code> and <code>POST /<wbr>logout</code>. The one thing Nuxt adds is a session: the theme's server keeps the cookies the site gave the visitor in one <code>http<wbr>Only</code> cookie of its own, sends them with every request, and names the site as the <code>Origin</code> of every POST, so the site's forms pass its forgery check as they would from its own pages.</p>
<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// server/utils/site.ts — every request to the site as the visitor</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> response</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $fetch.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">raw</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(site </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">+</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> path, {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">  headers: { Accept: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'application/json'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, Origin: site, Cookie: jar },</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">  ignoreResponseError: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">})</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// cookies the site set come back into the jar</span></span></code></pre>
</div><p>That is the whole integration. <code>use<wbr>Cart()</code> is one state for the header's count, the buttons and the cart page. The checkout form is not written in the theme either: the site's checkout page hands over its fields with their labels and which are required, the countries it sells and ships to, the states of each, the words a country uses for <em>state</em> and <em>postcode</em>, the payment methods with their descriptions, the terms to accept. A changed address re-prices the cart and the shipping rates come back with it; &quot;Place order&quot; posts the form to the site, which validates it against its own rules and answers either where to go next or a message per field. The receipt is the site's &quot;order received&quot; address, drawn by the theme. The account is the same: sign in, sign up, the orders with their pages, the addresses and the details, each view as the site draws it for that customer.</p>
<p>No CORS, because the browser only ever talks to Nuxt. No API keys, because the visitor is the visitor. No public endpoint opened on the site.</p>
<h2 id="what-you-get-for-the-templates-you-write" tabindex="-1">What you get for the templates you write <a class="header-anchor" href="#what-you-get-for-the-templates-you-write" aria-label="Permalink to &quot;What you get for the templates you write&quot;">&ZeroWidthSpace;</a></h2>
<p>Eight templates in Vue, plain CSS variables for the palette (cream paper, rust, pumpkin, mustard, moss) with a dark set, <code>@nuxt/<wbr>fonts</code> for the type, and a site that renders on the server with the right <code>&lt;head&gt;</code> on every address. The site keeps its admin — Filament or Nova, with the screens editors already know — its SEO, its languages, its activity log, and the agent that fills it. The storefront keeps Nuxt.</p>
<p>The theme is on GitHub: <a href="https://github.com/kitloom/harvest-theme" target="_blank" rel="noreferrer">kitloom/harvest-theme</a>. Point <code>NUXT_<wbr>PUBLIC_<wbr>SITE_<wbr>URL</code> at a kitloom site, run <code>npm run dev</code>, and it draws it; the README says the three things to switch on in the admin for guests to order.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>A sandbox is a site of your own for three days, with demo content and the admin, no sign-up: <a href="https://filament.kitloom.dev/pantry" target="_blank" rel="noreferrer">Pantry</a>, the nuts-and-dried-fruit shop the theme was built against. Put its address into the theme's <code>.<wbr>env</code> and the storefront is yours to change.</p>
<p>kitloom is a paid product — <a href="https://kitloom.dev/services.html#license">US$299 for one site</a>, or a site we build for you — and the <a href="https://kitloom.dev/docs/introduction.html">documentation</a> is open to everyone.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Deploy a Laravel CMS to DigitalOcean, Laravel Cloud or Docker — the files written from your site</title>
      <link>https://kitloom.dev/blog/deploy-a-laravel-cms-to-digitalocean-laravel-cloud-or-docker.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/deploy-a-laravel-cms-to-digitalocean-laravel-cloud-or-docker.html</guid>
      <pubDate>Sun, 25 Oct 2026 12:00:00 GMT</pubDate>
      <description>One command writes the deploy of a kitloom site: a server script and cloud-init, a Deployer recipe, a Laravel Cloud checklist, a Forge deploy script, a Dockerfile and compose, an App Platform spec — each filled in from the site as it is, and an AI agent to run them.</description>
      <content:encoded><![CDATA[<p>Every deployment guide for a Laravel application is right in general and wrong for your site in a few places. The guide says <code>npm run build</code>; your site has a Blade theme and no Node at all, or a Vue theme that also needs PHP during its build. It says <code>php artisan queue:<wbr>work</code>; your site runs Horizon, and the worker it set up starves on the default memory limit. It says <code>DB_<wbr>DATABASE=laravel</code>; your database came from a WordPress site and every table starts with <code>wp_</code>. It saves the Composer token in <code>auth.<wbr>json</code>; your admin is Nova and needs a second one. Each of these is a small thing, found at eleven at night with the site half up.</p>
<p>A CMS adds its own: uploads that must outlive a deploy, a queue that must run, a scheduler that must come by every minute, and packages from a private Composer repository. None of it is hard. All of it has to be right for <em>this</em> site.</p>
<h2 id="tell-the-agent" tabindex="-1">Tell the agent <a class="header-anchor" href="#tell-the-agent" aria-label="Permalink to &quot;Tell the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With Claude Code in the project, the deploy is a sentence:</p>
<blockquote>
<p><em>&quot;Deploy this site to a DigitalOcean Droplet in Frankfurt, domain example.com; the DNS is at Cloudflare.&quot;</em></p>
</blockquote>
<p>Every kitloom project carries a skill for it. The agent asks what it cannot know, writes the deploy files with the site's own kit (below), makes the Droplet with <code>doctl</code> and the kit's cloud-init file as user data, tells you the DNS record, puts the server's deploy key on the repository, deploys, checks that the front page and the admin's login page answer, and makes the first administrator — handing you the password once. It confirms before anything that costs money, and it never asks for the token in the chat. Any other agent gets the same instructions as a prompt: <a href="https://kitloom.dev/docs/deployment/ai-agent.html">With an AI agent</a>.</p>
<h2 id="one-command-the-files-for-this-site" tabindex="-1">One command, the files for this site <a class="header-anchor" href="#one-command-the-files-for-this-site" aria-label="Permalink to &quot;One command, the files for this site&quot;">&ZeroWidthSpace;</a></h2>
<p>Behind the agent, and for anyone who would rather hold the files, is <code>kitloom/<wbr>deploy</code>, a package every site has:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:deploy-kit</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> server</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">           # one VPS on Ubuntu 24.04</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:deploy-kit</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> laravel-cloud</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    # cloud.laravel.com</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:deploy-kit</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> forge</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">            # Laravel Forge or Ploi</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:deploy-kit</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> docker</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">           # any Docker host</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:deploy-kit</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> digitalocean-app</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D"> # DigitalOcean App Platform</span></span></code></pre>
</div><p>The command reads the site as it is installed — Filament at <code>/<wbr>admin</code> or Nova at <code>/<wbr>nova</code>, a Vue theme that needs npm or a Blade theme that does not, Horizon or a plain worker, Sentry, Import &amp; Export, the WordPress prefix of the database, the PHP version the project asks for — and writes the files for the target, filled in:</p>
<ul>
<li><strong><code>server</code></strong>: <code>deploy/<wbr>server.<wbr>sh</code> sets an Ubuntu 24.04 server up as root — PHP-FPM with the extensions, Nginx with the site's server block, MySQL with the site's database, Composer with your token, Node when a theme needs it, Redis when Horizon does, the <code>deploy</code> user, the site's <code>.<wbr>env</code> with a key and a password made up, cron, the worker as a systemd service, a certificate — and is safe to run again. <code>deploy/<wbr>cloud-<wbr>init.<wbr>yaml</code> is the same at the server's first boot, pasted as a Droplet's <strong>User data</strong>, Hetzner's cloud config or an EC2 instance's user data. <code>deploy.<wbr>php</code> is a <a href="https://deployer.org" target="_blank" rel="noreferrer">Deployer</a> recipe: a release in a folder of its own, switched live once built, migrated and checked, <code>dep rollback</code> to go back, <code>dep kitloom:<wbr>user</code> for the first administrator. A GitHub Actions workflow deploys on every push, with one secret, an SSH key; the token stays on the server.</li>
<li><strong><code>laravel-<wbr>cloud</code></strong>: Cloud keeps its settings in a dashboard, so the kit writes the checklist with this site's values — the resources, the build commands with the token (and Nova's), the worker, the scheduler — and <code>deploy/<wbr>laravel-<wbr>cloud.<wbr>env</code> to paste: the uploads on the bucket, the caches built in the build, the WordPress prefix.</li>
<li><strong><code>forge</code></strong>: the deploy script to paste into Forge or Ploi, with the theme build and the right restart for the worker, and the environment lines they do not know about.</li>
<li><strong><code>docker</code></strong>: a <code>Dockerfile</code> with PHP-FPM and Nginx in one container, the packages installed in a stage that stays out of the image so the token never reaches its history, the themes built in; <code>compose.<wbr>yml</code> with the site, the worker, the scheduler, MySQL and Redis on one host; and what a platform that runs the image needs — the uploads on S3, the worker and the scheduler as services.</li>
<li><strong><code>digitalocean-<wbr>app</code></strong>: the same image and <code>.<wbr>do/<wbr>app.<wbr>yaml</code> for <code>doctl apps create</code> — the web service, the worker and the scheduler, the managed MySQL bound in, the uploads in a Space, the domain.</li>
</ul>
<p>Every target also writes <code>deploy/<wbr>README.<wbr>md</code>, the steps for this site in order. Install Horizon next month, add a Vue theme, change the domain: run the kit again, and it rewrites its own files while keeping the ones you edited.</p>
<h2 id="what-the-kit-found" tabindex="-1">What the kit found <a class="header-anchor" href="#what-the-kit-found" aria-label="Permalink to &quot;What the kit found&quot;">&ZeroWidthSpace;</a></h2>
<p>The kit was written by deploying a site each way, and some of what it learned is not in the general guides. A TypeScript theme asks PHP for the site's page types while Vite builds it, so the Docker stage that builds the themes keeps PHP and borrows Node from its image. A console without OPcache boots the whole site at about 100 MB, which is more than Horizon lets its own process have, so the worker restarts in a loop until OPcache is on for the CLI — the kit turns it on, on the server and in the image. App Platform's development databases are Postgres only, so a MySQL site attaches a cluster made first. A container asks itself at 127.0.0.1 whether it is healthy, and a site that answers only its own hosts says no until that address is trusted. Each of these is one line in the right file; the kit knows which.</p>
<h2 id="where-kitloom-sits" tabindex="-1">Where kitloom sits <a class="header-anchor" href="#where-kitloom-sits" aria-label="Permalink to &quot;Where kitloom sits&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom is a Laravel CMS on the WordPress data model: an admin editors already know, in Filament or Nova; Blade, Vue or React on the front; modules for the shop, bookings, courses, forms and the rest; and an MCP server, so the agent that deployed the site goes on to run it — posts, SEO, orders — with exactly the rights of its user. A WordPress site comes along with its database, its URLs and its users. The deploy kit is how it gets onto a server: the files written from the site, by you or by the agent.</p>
<p><a href="https://kitloom.dev/docs/deployment.html">Deployment</a> has every target by hand as well; the <a href="https://demo.kitloom.dev" target="_blank" rel="noreferrer">sandbox</a> is a site to try without deploying anything.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Duplicate a post or page in Laravel — Yoast Duplicate Post's data, no WordPress</title>
      <link>https://kitloom.dev/blog/duplicate-a-post-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/duplicate-a-post-in-laravel.html</guid>
      <pubDate>Sun, 25 Oct 2026 12:00:00 GMT</pubDate>
      <description>Copy a post, a page or a product to a new draft in one click, clone many from the list, and rewrite a live page aside before it goes over the original — in Filament or Nova, and by an AI agent.</description>
      <content:encoded><![CDATA[<p>The workshop was full, so it runs again next month. The new post is the old one with another date: the same text, the same picture, the same categories, the same SEO fields. Without a copy button someone opens two tabs and pastes field by field, and the excerpt or the featured image is forgotten on the way. A page that is live has the opposite problem: the opening hours change next week, and every edit saved on it is on the site at once — half-written winter hours for a day, or a draft kept in a text file until Monday.</p>
<p>On WordPress, more than four million sites hand both to Yoast Duplicate Post. kitloom/duplicate-posts does the same on a Laravel site — and reads that plugin's own data, so a site that moves from WordPress keeps its settings, and its copies still know their originals.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With kitloom/ai connected, an AI agent copies and rewrites with the rights of the user whose key it holds:</p>
<ul>
<li><em>&quot;Copy the bookbinding workshop post to a new draft for the second evening.&quot;</em></li>
<li><em>&quot;Prepare the winter hours on the Visiting page, and put them live on Monday.&quot;</em></li>
<li><em>&quot;Make a copy of the walnut product for the 1 kg bag.&quot;</em></li>
</ul>
<p>It calls <code>duplicate_<wbr>posts_<wbr>copy</code>, <code>duplicate_<wbr>posts_<wbr>rewrite</code> and <code>duplicate_<wbr>posts_<wbr>republish</code>, and edits the copy with the content tools it already has. A copy is a draft by the agent's user; republishing asks for the right to publish the type, so an author's key prepares a rewrite and an editor puts it live. How to connect one: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="in-the-admin" tabindex="-1">In the admin <a class="header-anchor" href="#in-the-admin" aria-label="Permalink to &quot;In the admin&quot;">&ZeroWidthSpace;</a></h2>
<table tabindex="0">
<thead>
<tr>
<th>Action</th>
<th>What it does</th>
<th>Where</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>New draft</strong></td>
<td>copies the record and opens the copy</td>
<td>a row's menu in the list, the edit page</td>
</tr>
<tr>
<td><strong>Clone</strong></td>
<td>copies the record and leaves you in the list</td>
<td>a row's menu, the bulk actions</td>
</tr>
<tr>
<td><strong>Rewrite &amp; Republish</strong></td>
<td>makes a working copy of a published record</td>
<td>a row's menu, the edit page</td>
</tr>
<tr>
<td><strong>Republish</strong></td>
<td>writes the working copy over its original and deletes the copy</td>
<td>the copy's row and edit page</td>
</tr>
</tbody>
</table>
<p><strong>Duplicate Posts → Settings</strong> says what a copy takes — title, excerpt, content, featured image, template, post format and menu order at first; the date, status, slug, author and password if you tick them — a title prefix or suffix (&quot;Copy of&quot;, &quot;(copy)&quot;), the meta keys and taxonomies a copy leaves behind (<code>rank_<wbr>math_<wbr>*</code> keeps the SEO title with the original), which post types offer the actions, and where. An <strong>Original</strong> column in the list and a box on a copy's edit page say what each copy was made from.</p>
<p>Who may copy is a permission on the roles, <strong>Copy posts</strong>: administrators and editors have it at first, as the plugin gives it, and a user copies only what they may edit.</p>
<h2 id="rewrite-republish" tabindex="-1">Rewrite &amp; Republish <a class="header-anchor" href="#rewrite-republish" aria-label="Permalink to &quot;Rewrite &amp; Republish&quot;">&ZeroWidthSpace;</a></h2>
<p>Press <strong>Rewrite &amp; Republish</strong> on a published page and a draft copy of all of it opens: the words, the image, the custom fields, the terms. Edit it as long as you need; the page stays live as it was. <strong>Republish</strong> writes the copy over the original, which keeps its address, its date and its comments; the copy is deleted, and the original's revisions keep what it was before, so it can be restored.</p>
<p>To put it live on a day ahead, give the copy that date and publish it: it is scheduled, and on the day it goes over the page by itself — from the same scheduler line that publishes scheduled posts.</p>
<h2 id="what-else-goes-along" tabindex="-1">What else goes along <a class="header-anchor" href="#what-else-goes-along" aria-label="Permalink to &quot;What else goes along&quot;">&ZeroWidthSpace;</a></h2>
<p>Custom fields and other meta are copied as they are, and so are the terms. What never goes along: the editing lock, the old addresses kept for redirects, the revisions — a copy starts its own history. The other modules take care of their own data:</p>
<ul>
<li><strong>Languages</strong> — the translations are copied too, each at an address of its own in its language.</li>
<li><strong>Shop</strong> — a copied product has no SKU, no sales and no rating, as WooCommerce's own Duplicate makes it, and takes its variations; a rewrite leaves the stock as the shop counted it meanwhile.</li>
<li><strong>Future Actions</strong> — a scheduled unpublish stays with the original.</li>
<li><strong>Themes with fields in tables</strong> — the recipe card of a Saffron recipe is copied with it.</li>
</ul>
<h2 id="the-data-is-the-plugin-s" tabindex="-1">The data is the plugin's <a class="header-anchor" href="#the-data-is-the-plugin-s" aria-label="Permalink to &quot;The data is the plugin's&quot;">&ZeroWidthSpace;</a></h2>
<p>The settings are Yoast Duplicate Post's options under their own names — <code>duplicate_<wbr>post_<wbr>copytitle</code> and the rest, <code>duplicate_<wbr>post_<wbr>types_<wbr>enabled</code>, <code>duplicate_<wbr>post_<wbr>show_<wbr>link</code> — and a copy carries the plugin's marks: <code>_<wbr>dp_<wbr>original</code> for the record it was made from; a working copy <code>_<wbr>dp_<wbr>is_<wbr>rewrite_<wbr>republish_<wbr>copy</code>, its original <code>_<wbr>dp_<wbr>has_<wbr>rewrite_<wbr>republish_<wbr>copy</code>. The capability is the plugin's <code>copy_<wbr>posts</code>. A WordPress site that moves to kitloom keeps what it chose, and a copy that was being rewritten there can be republished here.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/duplicate-posts/filament/copy-a-post.jpg" src="https://media.kitloom.dev/lessons/duplicate-posts/filament/copy-a-post.mp4"></video>
  <figcaption>Copy a post to a new draft, and clone it from the list</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/duplicate-posts/filament/rewrite-and-republish.jpg" src="https://media.kitloom.dev/lessons/duplicate-posts/filament/rewrite-and-republish.mp4"></video>
  <figcaption>Rewrite & Republish a live page: the copy edited aside, then put over the original</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/duplicate-posts/filament/settings.jpg" src="https://media.kitloom.dev/lessons/duplicate-posts/filament/settings.mp4"></video>
  <figcaption>Duplicate Posts settings: what a copy takes, on which types, and where</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail of the module is in the <a href="https://kitloom.dev/docs/modules/guides/duplicate-posts.html">Duplicate Posts guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Safe SVG uploads in Laravel — every file cleaned, the Safe SVG plugin's settings kept</title>
      <link>https://kitloom.dev/blog/safe-svg-uploads-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/safe-svg-uploads-in-laravel.html</guid>
      <pubDate>Sun, 25 Oct 2026 12:00:00 GMT</pubDate>
      <description>SVG logos, icons and maps in the media library of a Laravel site: scripts, trackers and outside references taken out on the way in, for the roles you choose, also when an AI agent uploads them.</description>
      <content:encoded><![CDATA[<p>A designer sends the new logo as an SVG: sharp on a phone and on a 4K screen, a few kilobytes. The media library says <em>&quot;this file type is not permitted&quot;</em>, and it is right to. An SVG is a picture written as text, and that text may carry a script. Open the file at its address on your site and the script runs there, as the visitor: it reads their session, or loads a tracker from somewhere else. The designer never meant it; an icon pack downloaded from a free site, or an old export from a drawing program, may carry it all the same.</p>
<p>On WordPress, more than a million sites let SVG in through the Safe SVG plugin, which cleans each file as it is uploaded. kitloom/safe-svg does the same on a Laravel site, under the plugin's own names, so a site that moves from WordPress keeps who may upload SVG.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With kitloom/ai connected, an AI agent puts files into the media library with <code>upload_<wbr>media</code>, as the user whose key it holds:</p>
<ul>
<li><em>&quot;Upload the logo at <a href="https://example.com/brand/logo.svg" target="_blank" rel="noreferrer">https://example.com/brand/logo.svg</a> and make it the site's logo.&quot;</em></li>
<li><em>&quot;Here are our twelve category icons as SVG, add them to the library with sensible titles and alt texts.&quot;</em></li>
</ul>
<p>Every SVG the agent uploads goes through the same cleaner as one uploaded in the admin. And the key's user decides: an agent working with an author's key, on a site where authors may not upload SVG, is told the type is not permitted, just as the author would be. How to connect one: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="what-is-taken-out" tabindex="-1">What is taken out <a class="header-anchor" href="#what-is-taken-out" aria-label="Permalink to &quot;What is taken out&quot;">&ZeroWidthSpace;</a></h2>
<p>The cleaner keeps everything a drawing needs (shapes, paths, text, gradients, patterns, masks, filters, animation) and removes everything else:</p>
<table tabindex="0">
<thead>
<tr>
<th>Taken out</th>
<th>Why</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>&lt;script&gt;</code>, <code>onload</code>, <code>onclick</code> and every other handler</td>
<td>they run code when the file is opened</td>
</tr>
<tr>
<td><code>foreign<wbr>Object</code></td>
<td>HTML inside the picture, with its own scripts</td>
</tr>
<tr>
<td><code>&lt;use&gt;</code>, <code>&lt;image&gt;</code>, fills and CSS pointing to another address</td>
<td>they fetch from elsewhere, a tracker or a script of someone else's</td>
</tr>
<tr>
<td><code>&lt;set&gt;</code> and animation of a link</td>
<td>they turn a clean link into a script after the file is drawn</td>
</tr>
<tr>
<td>CSS <code>@import</code>, <code>expression()</code>, escapes</td>
<td>they load or run code, or hide what they do</td>
</tr>
<tr>
<td>Inkscape's and Illustrator's markup, RDF metadata, comments</td>
<td>nobody needs them on the site; the file gets smaller</td>
</tr>
</tbody>
</table>
<p>Pictures embedded inside the SVG (PNG, JPEG, GIF, WebP) and links to web or mail addresses stay. A file that is no SVG at all, declares XML entities (the &quot;billion laughs&quot; that hangs a server), or comes compressed as <code>.<wbr>svgz</code> is refused, and the message says why.</p>
<p>It cleans every way a file comes in: <strong>Media → Library</strong>, the editor's <strong>Add Media</strong>, the picker of a featured image, Nova's media library, a file fetched from a URL, an agent, and a WordPress import (WXR). It is written for kitloom from the SVG specification: an allowlist, so whatever a later SVG version adds stays out until someone has looked at it.</p>
<h2 id="who-may-upload-svg" tabindex="-1">Who may upload SVG <a class="header-anchor" href="#who-may-upload-svg" aria-label="Permalink to &quot;Who may upload SVG&quot;">&ZeroWidthSpace;</a></h2>
<p>When the module is installed, every role that may upload files gets <strong>Upload SVG files</strong>: on a fresh site administrators, editors and authors. <strong>Safe SVG → Settings</strong> says who holds it; <strong>Users → Roles</strong> changes it, by the same rules as every other permission.</p>
<p><strong>Allow large SVG files</strong> is the plugin's other setting: a detailed map or a technical drawing may be nested deeper than libxml reads by default. It costs memory, so it is off until you need it.</p>
<h2 id="the-data-is-the-plugin-s" tabindex="-1">The data is the plugin's <a class="header-anchor" href="#the-data-is-the-plugin-s" aria-label="Permalink to &quot;The data is the plugin's&quot;">&ZeroWidthSpace;</a></h2>
<p>The permission is the plugin's capability, <code>safe_<wbr>svg_<wbr>upload_<wbr>svg</code>, and the large-files setting its option, <code>safe_<wbr>svg_<wbr>large_<wbr>svg</code>. A WordPress site that moves to kitloom keeps the roles the plugin had given the right to, with nothing to import.</p>
<p>The SVG files that come along in <code>wp-<wbr>content/<wbr>uploads</code> were cleaned by the plugin when they were uploaded, but nothing says by which version. One command cleans them all again and reads their sizes:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> safe-svg:sanitize</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --dry-run</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">   # which files would change</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> safe-svg:sanitize</span></span></code></pre>
</div><p>Each SVG also gets its width and height in the attachment's metadata, read from the file's <code>width</code> and <code>height</code> or its <code>view<wbr>Box</code>, as the plugin writes them, so a theme's <code>&lt;img&gt;</code> has its size and the page does not jump as it loads.</p>
<h2 id="for-a-laravel-developer" tabindex="-1">For a Laravel developer <a class="header-anchor" href="#for-a-laravel-developer" aria-label="Permalink to &quot;For a Laravel developer&quot;">&ZeroWidthSpace;</a></h2>
<p>The module is one implementation of a contract of kitloom/media: a <code>Kitloom\<wbr>Media\<wbr>Contracts\<wbr>Upload<wbr>Filter</code> tagged <code>Upload<wbr>Filter::<wbr>TAG</code>. It names its extensions, who may upload them, and how a file is cleaned; the library adds the extensions for the signed-in user and passes every such file through it before it reaches the disk. A type of your own that is safe only once cleaned plugs in the same way. A second guard for the server, a <code>Content-<wbr>Security-<wbr>Policy</code> for <code>.<wbr>svg</code> in nginx, is in the <a href="https://kitloom.dev/docs/modules/guides/safe-svg.html">guide</a>.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/safe-svg/filament/upload-svg.jpg" src="https://media.kitloom.dev/lessons/safe-svg/filament/upload-svg.mp4"></video>
  <figcaption>Upload SVG files safely: a compass rose with a script and a tracker inside, stored clean</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/safe-svg/filament/settings.jpg" src="https://media.kitloom.dev/lessons/safe-svg/filament/settings.mp4"></video>
  <figcaption>Safe SVG settings: who may upload SVG, and large files</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail of the module is in the <a href="https://kitloom.dev/docs/modules/guides/safe-svg.html">Safe SVG guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Unpublish posts at a date in Laravel — PublishPress Future's data, no WordPress</title>
      <link>https://kitloom.dev/blog/unpublish-posts-at-a-date-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/unpublish-posts-at-a-date-in-laravel.html</guid>
      <pubDate>Sun, 25 Oct 2026 12:00:00 GMT</pubDate>
      <description>Posts and pages that go back to draft, become private, move to the trash or change categories at a date — set on the post's form, done by the scheduler, and asked for by an AI agent.</description>
      <content:encoded><![CDATA[<p>An autumn sale ends on Sunday night. Someone has to take its page down on Monday morning, and usually nobody does: the offer stays on the site for a month, a customer quotes it at the till, and the price list on the about page still says &quot;until October&quot;. The same happens to an event page after the event, a job ad after the deadline, a &quot;New&quot; badge on a product half a year old.</p>
<p>On WordPress, more than a hundred thousand sites hand this to PublishPress Future (it was Post Expirator before). kitloom/future-actions does the same on a Laravel site — and reads that plugin's own data, so a site that moves from WordPress keeps the actions it had scheduled.</p>
<h2 id="ask-the-agent" tabindex="-1">Ask the agent <a class="header-anchor" href="#ask-the-agent" aria-label="Permalink to &quot;Ask the agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With kitloom/ai connected, an AI agent schedules actions with the rights of the user whose key it holds:</p>
<ul>
<li><em>&quot;Take the autumn sale post off the site on Sunday at midnight.&quot;</em></li>
<li><em>&quot;Move every workshop post of October to Past workshops on November 1.&quot;</em></li>
<li><em>&quot;What is due to change on the site this week?&quot;</em></li>
</ul>
<p>It calls <code>future_<wbr>actions_<wbr>schedule</code>, <code>future_<wbr>actions_<wbr>list</code> and <code>future_<wbr>actions_<wbr>cancel</code>, and <code>describe_<wbr>site</code> tells it which post types have future actions and what each does by default. An author's key schedules only on the author's own posts; sticking a post to the blog's top asks for the right to edit others' posts, as WordPress asks it; nothing is deleted for good by a timer — a delete becomes the trash. How to connect one: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="on-the-post-s-form" tabindex="-1">On the post's form <a class="header-anchor" href="#on-the-post-s-form" aria-label="Permalink to &quot;On the post's form&quot;">&ZeroWidthSpace;</a></h2>
<p>Every post and page gets a <strong>Future action</strong> box: <strong>Enable future action</strong>, <strong>When</strong>, and the <strong>Action</strong>:</p>
<table tabindex="0">
<thead>
<tr>
<th>Action</th>
<th>What happens at the date</th>
</tr>
</thead>
<tbody>
<tr>
<td>Change status to draft, pending or private</td>
<td>the record leaves the site, or is kept for signed-in users</td>
</tr>
<tr>
<td>Move to the trash</td>
<td>into the trash, where it can be restored</td>
</tr>
<tr>
<td>Stick, Unstick</td>
<td>on or off the top of the blog</td>
</tr>
<tr>
<td>Replace, add or remove terms</td>
<td>the categories or tags you pick; or all of them come off</td>
</tr>
</tbody>
</table>
<p>The list of posts has a <strong>Future action</strong> column and filter, and a bulk action that gives many posts the same action at once. <strong>Future Actions → Scheduled</strong> lists everything that waits, of every type, the nearest first, with <strong>Cancel</strong>. In <strong>Settings</strong>, each post type is turned on or off and gets its default action and date — <code>+1 week</code>, or its own — and the addresses that hear when an action was done.</p>
<p>A sentence of the post can carry the date itself: <em>&quot;Every reading lamp is a fifth off until [futureaction type=date].&quot;</em> When the action is done or cancelled, the shortcode writes nothing.</p>
<h2 id="the-data-is-the-plugin-s" tabindex="-1">The data is the plugin's <a class="header-anchor" href="#the-data-is-the-plugin-s" aria-label="Permalink to &quot;The data is the plugin's&quot;">&ZeroWidthSpace;</a></h2>
<p>The action of a record is kept where PublishPress Future keeps it — post meta <code>_<wbr>expiration-<wbr>date</code>, <code>_<wbr>expiration-<wbr>date-<wbr>status</code>, <code>_<wbr>expiration-<wbr>date-<wbr>type</code> and the rest — and its options under the plugin's names (<code>expirationdate<wbr>Defaults<wbr>Post</code>, <code>expirationdate<wbr>Email<wbr>Notification</code>). The plugin keeps its own schedule in Action Scheduler, but it writes that meta on every schedule and can rebuild its schedule from it. So a WordPress site that moves to kitloom keeps every waiting action with nothing to import, and <code>[futureaction]</code> and the older <code>[postexpirator]</code> in its content keep showing their dates.</p>
<h2 id="done-by-the-scheduler" tabindex="-1">Done by the scheduler <a class="header-anchor" href="#done-by-the-scheduler" aria-label="Permalink to &quot;Done by the scheduler&quot;">&ZeroWidthSpace;</a></h2>
<p><code>future-<wbr>actions:<wbr>run</code> runs every minute from Laravel's scheduler — the usual <code>schedule:<wbr>run</code> cron line of the server. It does each action through the same writers the admin uses, so the change is announced as an edit would be: the activity log, webhooks, the page cache and the term counts follow. An action that fails — a post someone deleted meanwhile — is turned off and reported, and kitloom/notifications can send that to a Telegram or Slack channel (<strong>Future action failed</strong>).</p>
<p>The same cron line now also publishes <strong>scheduled posts</strong> at their time: a post dated ahead goes live by itself, as WordPress's <code>publish_<wbr>future_<wbr>post</code> does.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/future-actions/filament/unpublish-a-post.jpg" src="https://media.kitloom.dev/lessons/future-actions/filament/unpublish-a-post.mp4"></video>
  <figcaption>Unpublish a post at a date: the box, the column, the date in the text, the post back to draft</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/future-actions/filament/scheduled.jpg" src="https://media.kitloom.dev/lessons/future-actions/filament/scheduled.mp4"></video>
  <figcaption>Schedule many posts at once, and everything that waits in one list</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" poster="https://media.kitloom.dev/lessons/future-actions/filament/settings.jpg" src="https://media.kitloom.dev/lessons/future-actions/filament/settings.mp4"></video>
  <figcaption>Future Actions settings: defaults per post type, emails, the shortcode</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail of the module is in the <a href="https://kitloom.dev/docs/modules/guides/future-actions.html">Future Actions guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>A Vue or React site on Laravel, without writing the PHP</title>
      <link>https://kitloom.dev/blog/vue-react-site-on-laravel-without-php.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/vue-react-site-on-laravel-without-php.html</guid>
      <pubDate>Sun, 25 Oct 2026 12:00:00 GMT</pubDate>
      <description>For front-end developers: install a Laravel CMS from a skeleton, write the site in Vue or React templates with props typed from the server, get server-side rendering and a deploy out of the box, and let an AI agent fill the content — the PHP stays behind the admin, documented, and out of your way.</description>
      <content:encoded><![CDATA[<p>You build front ends. A client wants a site with an admin their editors can use, a blog, maybe a shop, and it has to rank. The usual answer is a headless CMS plus your own app: two deployments, an API to glue, a rendering layer you write, and the search engines left to the client side. The other usual answer is a PHP CMS, where the theme is PHP and so is everything you touch.</p>
<p>kitloom is a Laravel CMS where the theme is a Vue or React app and the rest is already there. You install it from a skeleton, write templates with props the server types for you, build, deploy with a kit, and the pages come out rendered on the server. You don't open the PHP unless you want to, and when you want to, it is documented. Here is what that looks like, step by step.</p>
<h2 id="the-content-is-not-your-job-either" tabindex="-1">The content is not your job either <a class="header-anchor" href="#the-content-is-not-your-job-either" aria-label="Permalink to &quot;The content is not your job either&quot;">&ZeroWidthSpace;</a></h2>
<p>Before the templates: who fills the site? With kitloom/ai an AI agent connects to the site over MCP and does the editor's work through the same code as the admin, as the user whose key it holds. Hand it the brief:</p>
<ul>
<li><em>&quot;Create the About, Services and Contact pages from this text, and put them in the header menu.&quot;</em></li>
<li><em>&quot;Write ten posts for the blog's demo, each with a cover and an excerpt.&quot;</em></li>
<li><em>&quot;Upload these twelve icons and give them alt texts.&quot;</em></li>
</ul>
<p><code>create_<wbr>content</code>, <code>menu_<wbr>save</code>, <code>upload_<wbr>media</code> — every module brings its tools, nothing is deleted for good, and every change is in the activity log. So while you build the templates, the content you build against is real, and you never spent an afternoon in the admin pasting lorem ipsum. <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a> shows the setup.</p>
<h2 id="_1-install-one-command-a-site-with-an-admin" tabindex="-1">1. Install: one command, a site with an admin <a class="header-anchor" href="#_1-install-one-command-a-site-with-an-admin" aria-label="Permalink to &quot;1. Install: one command, a site with an admin&quot;">&ZeroWidthSpace;</a></h2>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> create-project</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom/filament-skeleton</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> my-site</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --repository=https://packages.kitloom.dev</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --add-repository</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> my-site</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> &#x26;&#x26; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> run</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> dev</span></span></code></pre>
</div><p><code>create-<wbr>project</code> asks which modules the site keeps (SEO, forms, the shop, comments…) and which theme, builds the theme and fills the site with the theme's demo if you say yes. What comes up is a Laravel application with Filament (or Nova) as the admin: posts, pages, media, menus, users, settings — the screens editors already know, on the WordPress data model, with no WordPress inside. Already on WordPress? The site <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">comes along</a> with its database and URLs.</p>
<p>Pick a theme from the <a href="https://kitloom.dev/docs/themes/catalog.html">catalog</a> to start from — eleven in Vue, one in React — or generate an empty one:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:make-theme</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> Studio</span></span></code></pre>
</div><h2 id="_2-your-part-a-template-per-kind-of-page" tabindex="-1">2. Your part: a template per kind of page <a class="header-anchor" href="#_2-your-part-a-template-per-kind-of-page" aria-label="Permalink to &quot;2. Your part: a template per kind of page&quot;">&ZeroWidthSpace;</a></h2>
<p>A theme's templates live in <code>resources/<wbr>js/<wbr>Templates/</code>, named as the WordPress template hierarchy names them: <code>front-<wbr>page.<wbr>vue</code>, <code>single.<wbr>vue</code>, <code>page.<wbr>vue</code>, <code>archive.<wbr>vue</code>, <code>search.<wbr>vue</code>, <code>404.<wbr>vue</code>. The server resolves the request, picks the most specific template the theme has, and renders it as an Inertia page. A React theme has the same files as <code>.<wbr>tsx</code>.</p>
<p>What a template gets are <em>parts</em>: the content, the menus, the site's name and logo, the comments, a product — each a typed object. The theme says which parts each template needs, and that list is the one PHP file you will see, written by the generator:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">protected</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $parts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">    '*'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">       =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">SiteInfo</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Content</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Menus</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">],</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">    'single'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  =></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Comments</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">],</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">];</span></span></code></pre>
</div><p>The props are typed from the server, not by hand. <code>php artisan kitloom:<wbr>schema --<wbr>types</code> writes <code>resources/<wbr>js/<wbr>kitloom.<wbr>d.<wbr>ts</code> from the parts' schemas, and the build runs it before a TypeScript theme compiles, so the file is never stale:</p>
<div class="language-vue vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">script</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> setup</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> lang</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"ts"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">import</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { PageProps } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> '../kitloom'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">defineProps</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">PageProps</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'content'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'menus'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">>>();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">script</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    &#x3C;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">h1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">>{{ content.title }}&#x3C;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">h1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    &#x3C;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">div</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> v-html</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"content.content"</span><span style="--shiki-light:#B31D28;--shiki-light-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic"> /</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></span></code></pre>
</div><p>A key that no part gives fails the type check, not the site. Navigation between pages is Inertia's: no full reloads, the next page's parts arrive as JSON. Anything below the first screen the theme can mark as deferred, and it comes after the page has shown.</p>
<p>You have a design already? <a href="https://kitloom.dev/docs/themes/from-template.html">From an HTML template</a> is the checklist two of the bundled themes were made by. You want to change one of the bundled themes a little? A <a href="https://kitloom.dev/docs/themes/child-themes.html">child theme</a> holds only the files you change, and <code>@/<wbr>Components/<wbr>Header.<wbr>vue</code> in the parent's templates picks up yours.</p>
<h2 id="_3-rendered-on-the-server-out-of-the-box" tabindex="-1">3. Rendered on the server, out of the box <a class="header-anchor" href="#_3-rendered-on-the-server-out-of-the-box" aria-label="Permalink to &quot;3. Rendered on the server, out of the box&quot;">&ZeroWidthSpace;</a></h2>
<p>Search engines, link previews and a reader's AI assistant get the page as HTML, not an empty <code>&lt;div&gt;</code> waiting for JavaScript. Every Vue and React theme comes with a server entry beside its client one, and the build makes both:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">npm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> run</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> build:themes</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">          # every theme: the client bundle and the SSR bundle</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> inertia:start-ssr</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D"> # one Node process renders them all</span></span></code></pre>
</div><p>That is the whole setup. There is nothing to configure in PHP: with the server running, a page's first response carries the template's markup and its <code>&lt;title&gt;</code> and meta; with the server down, the page is drawn in the browser as before, and the site never breaks. The same address also answers as data — <code>Accept:<wbr> application/<wbr>json</code> for a mobile app or another front end, <code>Accept:<wbr> text/<wbr>markdown</code> for an agent that reads the page as text. <a href="https://kitloom.dev/docs/themes/creating.html#server-side-rendering">Writing a Theme → Server-side rendering</a>, <a href="https://kitloom.dev/docs/headless.html">Headless &amp; APIs</a>.</p>
<h2 id="_4-deploy-with-a-kit-not-a-devops-course" tabindex="-1">4. Deploy with a kit, not a DevOps course <a class="header-anchor" href="#_4-deploy-with-a-kit-not-a-devops-course" aria-label="Permalink to &quot;4. Deploy with a kit, not a DevOps course&quot;">&ZeroWidthSpace;</a></h2>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:deploy-kit</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> server</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">     # or forge, docker, laravel-cloud, digitalocean-app</span></span></code></pre>
</div><p>The kit reads the site as it is — the admin, the theme, the modules, whether a theme needs Node — and writes the files that put it on a server: a script that sets the server up, a deploy recipe, a CI workflow, with the queue worker and the SSR server kept running as services. The <a href="https://kitloom.dev/docs/deployment.html">deployment guide</a> says what each target expects, and <a href="https://kitloom.dev/blog/deploy-a-laravel-cms-to-digitalocean-laravel-cloud-or-docker.html">Deploy a Laravel CMS to DigitalOcean, Laravel Cloud or Docker</a> walks through three of them.</p>
<h2 id="_5-documented-all-of-it" tabindex="-1">5. Documented, all of it <a class="header-anchor" href="#_5-documented-all-of-it" aria-label="Permalink to &quot;5. Documented, all of it&quot;">&ZeroWidthSpace;</a></h2>
<p>Everything above has a page, written for the person doing it:</p>
<ul>
<li><a href="https://kitloom.dev/docs/themes/creating.html">Writing a Theme</a> — the files, the parts, the typed props, Vue and React, the root view, SSR.</li>
<li><a href="https://kitloom.dev/docs/themes/generator.html">Generating a Theme</a> — <code>kitloom:<wbr>make-<wbr>theme</code>, with a type of its own, a taxonomy and fields if the site needs them.</li>
<li><a href="https://kitloom.dev/docs/themes/from-template.html">From an HTML template</a> and <a href="https://kitloom.dev/docs/themes/child-themes.html">Child themes</a>.</li>
<li><a href="https://kitloom.dev/docs/headless.html">Headless &amp; APIs</a> — every page as JSON, the REST API, the MCP server.</li>
<li><a href="https://kitloom.dev/docs/deployment.html">Deployment</a> — what a server needs and the kit's targets.</li>
<li>The <a href="https://kitloom.dev/docs/themes/catalog.html">theme catalog</a>: twelve themes with demos, each a working example of the above.</li>
</ul>
<p>And the PHP? It is Laravel, in the open, with tests. The day a template needs data no module gives — the three latest projects of a client, say — a part is a small PHP class with a schema, and the docs show one. Until that day, you don't have to look.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Two sandboxes, each a site of your own for three days, with demo content and the admin — no sign-up:</p>
<ul>
<li>Vue: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Journal</a>, a blog.</li>
<li>React: <a href="https://filament.kitloom.dev/quire" target="_blank" rel="noreferrer">Quire</a>, a stationery shop.</li>
</ul>
<p>kitloom is a paid product — <a href="https://kitloom.dev/services.html#license">US$299 for one site</a>, or a site we build for you — and the <a href="https://kitloom.dev/docs/introduction.html">documentation</a> is open to everyone.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Telegram and Slack notifications in Laravel, without code</title>
      <link>https://kitloom.dev/blog/telegram-notifications-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/telegram-notifications-in-laravel.html</guid>
      <pubDate>Sat, 24 Oct 2026 12:00:00 GMT</pubDate>
      <description>Telegram, Slack and email notifications for a Laravel site: new orders, bookings, form messages and failed backups, set up in the admin in a few minutes.</description>
      <content:encoded><![CDATA[<p>A site's owner rarely sits in the admin. They hear about a new order from an email they may open tomorrow, about a failed backup from nobody, and about the contact form when a customer calls to ask why no one answered. What they do read, all day, is a chat.</p>
<p>Laravel has had notification channels for years, and a Telegram message is one HTTP call. Wiring them to a site is still the same work every time: which events are worth a message, who gets what, how to keep a bot token out of the code, what to do when the chat removes the bot, how not to send the same &quot;low stock&quot; fifty times. <code>kitloom/<wbr>notifications</code> is that work done once, for every module of the site.</p>
<h2 id="what-the-owner-gets" tabindex="-1">What the owner gets <a class="header-anchor" href="#what-the-owner-gets" aria-label="Permalink to &quot;What the owner gets&quot;">&ZeroWidthSpace;</a></h2>
<p>A <strong>channel</strong> is one place to send to — a Telegram chat, a Slack channel or an email address — with the news it wants ticked. The site sends each piece of news to every channel that ticked it:</p>
<table tabindex="0">
<thead>
<tr>
<th>From</th>
<th>News</th>
</tr>
</thead>
<tbody>
<tr>
<td>Shop</td>
<td>a new order (exactly when the shop's &quot;New order&quot; email goes), a cancelled, failed or refunded one, low or no stock, a backorder, a new customer, a review waiting</td>
</tr>
<tr>
<td>Bookings</td>
<td>a new booking, saying whether it waits for confirmation; a client's own cancellation</td>
</tr>
<tr>
<td>Contact forms</td>
<td>every message that got through, its fields as the form shows them</td>
</tr>
<tr>
<td>Listings, Courses</td>
<td>an enquiry about a listing; a new student, a course review waiting</td>
</tr>
<tr>
<td>Comments, Privacy</td>
<td>a comment waiting for approval; a personal data request to answer, with the date to answer by</td>
</tr>
<tr>
<td>Site health</td>
<td>a failing health check, a failed backup, links that broke since yesterday</td>
</tr>
<tr>
<td>Security</td>
<td>sign-ins locked out, a role raised, a module switched, an admin signed in as someone else</td>
</tr>
</tbody>
</table>
<p>A message is short: a heading (&quot;New order #1042 — $84.00&quot;), a few lines — the customer, the items, the payment method — a button that opens the record in the admin, and one to the page on the site. It is written in the site's language, not in the language of whoever happened to cause it.</p>
<h2 id="set-up-in-the-admin" tabindex="-1">Set up in the admin <a class="header-anchor" href="#set-up-in-the-admin" aria-label="Permalink to &quot;Set up in the admin&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Notifications → Channels → New channel</strong>, a name, <strong>Send to</strong> Telegram, Slack or Email:</p>
<ul>
<li><strong>Telegram</strong>: a bot from @BotFather — <code>/<wbr>newbot</code>, a name, and it hands you a token. Open the bot and press Start, or add it to your team's group. Paste the token, press <strong>Find the chat</strong>, and the site lists the chats that wrote to the bot; pick yours. No chat ids to look up.</li>
<li><strong>Slack</strong>: an app with Incoming Webhooks on, a webhook for the channel, its URL pasted in.</li>
<li><strong>Email</strong>: one address or several.</li>
</ul>
<p>The news worth acting on is ticked on a new channel already; the rest is a tick away. <strong>Send test</strong> sends one at once and says whether it got through. The token and the webhook URL are encrypted with the application key and never shown again.</p>
<p>A user ticks only the news they could see themselves: a shop manager given the Notifications section can send orders to the warehouse chat, but not failed backups or locked sign-ins. A channel another admin set up keeps the topics the manager may not see.</p>
<h2 id="the-parts-you-would-otherwise-build" tabindex="-1">The parts you would otherwise build <a class="header-anchor" href="#the-parts-you-would-otherwise-build" aria-label="Permalink to &quot;The parts you would otherwise build&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>Repeats are held back.</strong> A product that stays low in stock, a health check that fails at every run — each reaches a channel once in a while (an hour by default), not at every order. A new order or a booking is never held back.</li>
<li><strong>A broken channel says so.</strong> A bot removed from its group fails every message; after five in a row the channel is turned off, the site's administrator gets an email, and Site Health warns until someone fixes it.</li>
<li><strong>Nothing slows the checkout.</strong> Messages go from the queue. A Telegram outage does not make an order fail.</li>
<li><strong>Nothing is kept.</strong> The site stores no copy of the messages: what was sent is in the chat. A switch keeps customers' names and addresses out of a chat shared with people outside the team.</li>
<li><strong>No SDK.</strong> Telegram and Slack are called over Laravel's HTTP client; email goes through Laravel's notifications, so the application hears <code>Notification<wbr>Sent</code> as for any other.</li>
</ul>
<h2 id="run-it-from-an-ai-agent" tabindex="-1">Run it from an AI agent <a class="header-anchor" href="#run-it-from-an-ai-agent" aria-label="Permalink to &quot;Run it from an AI agent&quot;">&ZeroWidthSpace;</a></h2>
<p>Channels are open to an AI agent connected to the site through <code>kitloom/<wbr>ai</code>. It lists them with their news and their last error (<code>notifications_<wbr>list</code>), changes their name, their news and whether they are on (<code>notifications_<wbr>update</code>), and sends a test (<code>notifications_<wbr>test</code>). You ask:</p>
<ul>
<li><em>&quot;Stop telling the shop chat about reviews, and add failed payments to it.&quot;</em></li>
<li><em>&quot;Which channels failed this week, and why?&quot;</em></li>
<li><em>&quot;Send a test to the team's Telegram.&quot;</em></li>
</ul>
<p>The agent acts as the user whose key it holds: it adds only news that user could see, and only if that user may manage notifications. It never sees a bot token or a webhook URL, and it cannot make a channel or change where one sends — that needs a secret, and secrets stay out of chats. It deletes nothing; it can turn a channel off. <code>describe_<wbr>site</code> tells it every topic there is before it starts. How to connect one: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="your-module-s-own-news" tabindex="-1">Your module's own news <a class="header-anchor" href="#your-module-s-own-news" aria-label="Permalink to &quot;Your module's own news&quot;">&ZeroWidthSpace;</a></h2>
<p>A module of your own tells the owner its news with one class: a <code>Notification<wbr>Topic</code> — its name, the events it hears, which of them count, and the message it makes — tagged in the module's provider. The channels' form lists it, the owner ticks it, and the module never requires the notifications module to do so. The example and the rules are in <a href="https://kitloom.dev/docs/modules/extending.html#telling-the-owner">Extending › Telling the owner</a>.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>Two short lessons from the admin, narrated:</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" src="https://media.kitloom.dev/lessons/notifications/filament/telegram-channel.mp4#t=3"></video>
  <figcaption>Notifications in Telegram: a bot, the chat found from it, the news ticked, a test</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" src="https://media.kitloom.dev/lessons/notifications/filament/settings.mp4#t=3"></video>
  <figcaption>Notification settings: repeats, the record's details, a channel that keeps failing</figcaption>
</figure>
</div>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Every detail of the module is in the <a href="https://kitloom.dev/docs/modules/guides/notifications.html">Notifications guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>WooCommerce PDF Invoices in Laravel: keep numbers and settings</title>
      <link>https://kitloom.dev/blog/woocommerce-pdf-invoices-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/woocommerce-pdf-invoices-in-laravel.html</guid>
      <pubDate>Sat, 24 Oct 2026 12:00:00 GMT</pubDate>
      <description>WooCommerce PDF Invoices &amp; Packing Slips in Laravel: kitloom/invoices reads the plugin's numbers, dates and settings and goes on numbering from the last invoice.</description>
      <content:encoded><![CDATA[<p>Invoices are the one part of a shop an accountant cares about. They have to be numbered without gaps, never twice, and an invoice sent last spring has to come out the same when the customer asks for it again. On a WooCommerce shop that is usually the job of <strong>PDF Invoices &amp; Packing Slips</strong> by WP Overnight, and its data sits in the shop's database next to the orders.</p>
<p>Here is where the plugin keeps it:</p>
<ul>
<li><strong>An order's invoice</strong> is in the order's meta: <code>_<wbr>wcpdf_<wbr>invoice_<wbr>number</code> as printed (<code>INV-<wbr>2026-<wbr>0042</code>), <code>_<wbr>wcpdf_<wbr>invoice_<wbr>number_<wbr>data</code> (the number, its prefix, suffix and padding), <code>_<wbr>wcpdf_<wbr>invoice_<wbr>date</code>, the settings it was made with in <code>_<wbr>wcpdf_<wbr>invoice_<wbr>settings</code>, and what made it in <code>_<wbr>wcpdf_<wbr>invoice_<wbr>creation_<wbr>trigger</code>.</li>
<li><strong>The numbering</strong> is a table of its own, <code>wcpdf_<wbr>invoice_<wbr>number</code>, with last years' numbers in <code>wcpdf_<wbr>invoice_<wbr>number_<wbr>{year}</code> when it starts again every January.</li>
<li><strong>The settings</strong> are its options: <code>wpo_<wbr>wcpdf_<wbr>settings_<wbr>general</code> for the shop's details and the paper, <code>wpo_<wbr>wcpdf_<wbr>documents_<wbr>settings_<wbr>invoice</code> and <code>…_<wbr>packing-<wbr>slip</code> for each document.</li>
</ul>
<p>A usual Laravel rebuild of a shop starts invoices from 1, or prints them from a template that has never seen the old ones. The accountant then has two numberings, and an old invoice comes out with today's address on it.</p>
<h2 id="how-kitloom-reads-it" tabindex="-1">How kitloom reads it <a class="header-anchor" href="#how-kitloom-reads-it" aria-label="Permalink to &quot;How kitloom reads it&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom runs on the WordPress database as it is, and its shop keeps WooCommerce's orders in WooCommerce's tables. <code>kitloom/<wbr>invoices</code> reads the plugin's data where the plugin left it:</p>
<ul>
<li><strong>Old invoices stay as they were.</strong> An order that had invoice <code>INV-<wbr>2025-<wbr>0317</code> still has it, with its date, and is drawn with the shop details it was made with — the old address on the old invoice.</li>
<li><strong>The numbering goes on.</strong> The next invoice takes the next number of the plugin's counter, under a lock: two orders paid at the same moment never get the same one. Prefix, suffix, padding and the yearly reset are read from the plugin's settings, placeholders included (<code>[invoice_<wbr>year]</code>, <code>[order_<wbr>number]</code>, <code>[invoice_<wbr>date=&quot;ymd&quot;]</code>).</li>
<li><strong>An invoice is made once, for good</strong>, as the plugin does it: when an email you chose goes out with the PDF, when the order reaches a status you chose, when you or the customer open it, or when you set its number by hand. A cancelled order keeps its number.</li>
<li><strong>The packing slip</strong> is there too: the shipping address and the lines with SKU and weight, no prices.</li>
</ul>
<p>The documents speak the language the customer ordered in, as the shop's emails to them do.</p>
<h2 id="what-the-admin-shows" tabindex="-1">What the admin shows <a class="header-anchor" href="#what-the-admin-shows" aria-label="Permalink to &quot;What the admin shows&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Invoice</strong>, <strong>Packing slip</strong> and <strong>Invoice number</strong> are on every order's row and page, in Filament and in Nova. <strong>Invoices → Settings</strong> holds what the plugin's settings held: the shop's details and logo, the emails that carry the invoice, the numbering, when the customer's account offers the invoice, the paper and whether the PDF opens or downloads. A new shop has no email ticked: nothing is numbered until you say how.</p>
<p>Whoever may edit the shop's orders opens both documents of any order. A customer opens their own order's invoice from their account, signed in, and nothing else: another order's address answers &quot;not found&quot;.</p>
<h2 id="what-changes-and-what-is-not-covered" tabindex="-1">What changes and what is not covered <a class="header-anchor" href="#what-changes-and-what-is-not-covered" aria-label="Permalink to &quot;What changes and what is not covered&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>The move is one way.</strong> The plugin's options are read as WordPress left them and written as JSON from then on; the plugin on WordPress would not read them back.</li>
<li><strong>Two documents.</strong> The invoice and the packing slip, the plugin's free ones. Documents of its paid extensions — proforma invoices, credit notes — are not read.</li>
<li><strong>The look is kitloom's.</strong> The plugin's PHP templates do not run; the PDF is drawn by the module's Blade views, which you can publish and change. dompdf draws it in PHP, so nothing to install on the server, but it draws CSS 2.1 (tables, no flexbox) and does not join Arabic or Hebrew letters.</li>
<li><strong>PDFs are not stored.</strong> Each is drawn when it is opened or sent, from the order and its number.</li>
</ul>
<p>The complete list of what is read is in the <a href="https://kitloom.dev/docs/modules/guides/invoices.html">Invoices guide</a>.</p>
<h2 id="ask-an-ai-agent-for-an-invoice" tabindex="-1">Ask an AI agent for an invoice <a class="header-anchor" href="#ask-an-ai-agent-for-an-invoice" aria-label="Permalink to &quot;Ask an AI agent for an invoice&quot;">&ZeroWidthSpace;</a></h2>
<p>A customer writes &quot;can you send me the invoice for my last order?&quot;. With <code>kitloom/<wbr>ai</code> installed, an agent connected to the site finds the order and its invoice (<code>invoices_<wbr>get</code>) — the number as printed, the date, and links to the PDFs that open without signing in for half an hour — and makes one when the order has none yet (<code>invoices_<wbr>create</code>). You ask:</p>
<ul>
<li><em>&quot;Send me the invoice links for order 1042.&quot;</em></li>
<li><em>&quot;Which of today's orders have no invoice yet?&quot;</em></li>
<li><em>&quot;Make the invoice for order 1051 — the customer needs it for their company.&quot;</em></li>
</ul>
<p>The agent acts as the user whose key it holds and needs that user's right to manage orders. It takes a number only when asked, since a number is taken for good, and it never changes an invoice already made. With <code>kitloom/<wbr>webhooks</code>, the topic <code>invoice.<wbr>created</code> hands every new invoice to a bookkeeping app. How to connect an agent: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>Two short lessons from the admin, narrated:</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" src="https://media.kitloom.dev/lessons/invoices/filament/settings.mp4#t=3"></video>
  <figcaption>Set up invoices: the shop's details, the emails, the numbering</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" src="https://media.kitloom.dev/lessons/invoices/filament/order-documents.mp4#t=3"></video>
  <figcaption>Invoices on an order: the invoice, the packing slip, a number set by hand</figcaption>
</figure>
</div>
<h2 id="check-it-on-your-own-shop" tabindex="-1">Check it on your own shop <a class="header-anchor" href="#check-it-on-your-own-shop" aria-label="Permalink to &quot;Check it on your own shop&quot;">&ZeroWidthSpace;</a></h2>
<p>Point kitloom at a read-only copy of the live database and open a few old orders: their invoices should come out with the numbers and dates the customers received. Making a new invoice writes the counter, so try that on a copy you load yourself — the steps are in <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a>.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Invoices are one plugin among several; the same approach covers <a href="https://kitloom.dev/blog/woocommerce-to-laravel.html">WooCommerce itself</a>, <a href="https://kitloom.dev/blog/contact-form-7-in-laravel.html">Contact Form 7</a> and <a href="https://kitloom.dev/blog/rank-math-in-laravel.html">Rank Math</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Child themes in Laravel, the WordPress way</title>
      <link>https://kitloom.dev/blog/child-themes-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/child-themes-in-laravel.html</guid>
      <pubDate>Fri, 23 Oct 2026 12:00:00 GMT</pubDate>
      <description>Make a kitloom child theme the WordPress way: override a template, layout or Vue component, change colours in Customize, keep the parent's updates and SEO.</description>
      <content:encoded><![CDATA[<p>Every site built on a ready-made theme reaches the same moment: the theme is almost right. The footer needs one more line, the header another colour, the post page a different layout. There are two quick ways to get there, and both cost you later.</p>
<p><strong>Edit the theme in place,</strong> and the next <code>composer update</code> overwrites your changes — or you stop updating, and the theme's fixes for security, speed and new browsers never reach you. <strong>Fork it,</strong> and you own every line of it from then on, merging each upstream release by hand.</p>
<p>WordPress solved this years ago with child themes, and most WordPress developers reach for one without thinking. kitloom now has them too, built the same way: a child theme holds only what it changes and takes everything else from its parent — including the parent's updates.</p>
<h2 id="what-a-child-theme-is" tabindex="-1">What a child theme is <a class="header-anchor" href="#what-a-child-theme-is" aria-label="Permalink to &quot;What a child theme is&quot;">&ZeroWidthSpace;</a></h2>
<p>A child theme is a theme with a <em>parent</em>. Where WordPress reads <code>Template:<wbr> twentytwentyfive</code> from a child's <code>style.<wbr>css</code>, kitloom reads the parent's name from the child's <code>composer.<wbr>json</code>:</p>
<div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">{</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">    "extra"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">        "kitloom"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">            "theme"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">                "parent"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"Journal"</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">            }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>A folder <code>themes/<wbr>Inkwell/</code> with that file and one changed template is a complete child theme. It needs no service provider and no package.</p>
<p>When a page is drawn, kitloom walks the WordPress template hierarchy as usual, but asks for each template name twice: first in the child, then in the parent, before it moves on to the next name. The same order applies to Blade views and to the Vue or React components a template imports.</p>
<figure>
  <img src="https://kitloom.dev/blog/child-themes/template-lookup.svg" width="1200" height="640" alt="A table of template names for two pages. For /about/, the names page-about and page-12 are found in neither theme, and page is found in the child Inkwell first, so the child's page template is used. For a post, single-post is found in neither, and single only in the parent Journal, so the parent's template is used." loading="lazy">
  <figcaption>Each name of the template hierarchy is asked of the child first, then of its parent.</figcaption>
</figure>
<h2 id="first-check-whether-you-need-one-at-all" tabindex="-1">First, check whether you need one at all <a class="header-anchor" href="#first-check-whether-you-need-one-at-all" aria-label="Permalink to &quot;First, check whether you need one at all&quot;">&ZeroWidthSpace;</a></h2>
<p>Many of the changes people make child themes for are not code. The accent colour, the logo, the line under the footer, a sidebar on the left instead of the right: in kitloom, a theme declares these as settings, and the site's owner changes them on <strong>Appearance → Customize</strong>, beside a live preview of the site.</p>
<figure>
  <img src="https://kitloom.dev/blog/child-themes/customize.jpg" width="1600" height="1000" alt="The Customize screen in the Filament admin: Colors, Header and Footer sections with the accent colour, the logo and the footer text on the left, and the site in a frame on the right drawn with the new accent." loading="lazy">
  <figcaption>Appearance → Customize: the change shows in the frame at once, and only you see it until you publish.</figcaption>
</figure>
<p>The preview is a draft only you can see, for an hour, in any tab. It is never cached and never indexed. <strong>Publish</strong> makes it live for everyone. If that covers what you wanted, stop here: there is no child theme to maintain.</p>
<h2 id="make-a-child-theme-in-one-command" tabindex="-1">Make a child theme in one command <a class="header-anchor" href="#make-a-child-theme-in-one-command" aria-label="Permalink to &quot;Make a child theme in one command&quot;">&ZeroWidthSpace;</a></h2>
<p>When you do need code, the theme generator writes the child for you:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:make-theme</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> Inkwell</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --parent=Journal</span></span></code></pre>
</div><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span>themes/Inkwell/</span></span>
<span class="line"><span>├── composer.json          the parent's name, the child's card on Appearance → Themes</span></span>
<span class="line"><span>├── README.md              how to override, and every file of Journal you may override</span></span>
<span class="line"><span>└── resources/</span></span>
<span class="line"><span>    └── style.css          loaded after Journal's styles</span></span></code></pre>
</div><p>To start from one of the parent's files, copy it over as you make the child, or later:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> artisan</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom:make-theme</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> Inkwell</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --parent=Journal</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --copy=Components/Masthead.vue,Templates/page</span></span></code></pre>
</div><p>The command copies only the files you name, and never over one the child already has. A child meant for several sites can be a Composer package instead (<code>--<wbr>package --<wbr>vendor=acme</code>), with its own service provider and test.</p>
<p>Appearance → Themes then shows both themes, and tells you which is which:</p>
<figure>
  <img src="https://kitloom.dev/blog/child-themes/themes.jpg" width="1600" height="1000" alt="The Themes screen: the Inkwell card is active and says Vue, Child of Journal, with Customize and Deactivate buttons; the Journal card further down says Parent of Inkwell." loading="lazy">
  <figcaption>The child's card names its parent; while the child is active, the parent's card says so too.</figcaption>
</figure>
<h2 id="override-a-template-a-layout-or-a-component" tabindex="-1">Override a template, a layout or a component <a class="header-anchor" href="#override-a-template-a-layout-or-a-component" aria-label="Permalink to &quot;Override a template, a layout or a component&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>A Blade theme.</strong> Put a view of the same path in the child, and every page uses it — also pages drawn by the parent's own templates. To wrap the parent's view instead of copying it, name it with <code>parent::</code>:</p>
<div class="language-blade vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">blade</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">{{-- themes/Ledger/resources/views/layouts/app.blade.php --}}</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">@extends</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'parent::layouts.app'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span></span></code></pre>
</div><p><strong>A Vue or React theme.</strong> Imports through <code>@/</code> look in the child first. Put <code>resources/<wbr>js/<wbr>Components/<wbr>Masthead.<wbr>vue</code> in the child, and every template that imports <code>@/<wbr>Components/<wbr>Masthead.<wbr>vue</code> gets the child's — the parent's templates included. <code>@parent/</code> always means the parent's file:</p>
<div class="language-vue vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">script</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> setup</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ParentMasthead </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> '@parent/Components/Masthead.vue'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">script</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    &#x3C;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">ParentMasthead</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> v-bind</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"$attrs"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> /></span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    &#x3C;</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">p</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"masthead-note"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">>Printed in the hills&#x3C;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">p</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">&#x3C;/</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">template</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></span></code></pre>
</div><p>The child is built on its own (<code>APP_<wbr>THEME=Inkwell npx vite build</code>). It has no entry script of its own, so it is built from the parent's entry, with the child's <code>style.<wbr>css</code> added after the parent's styles.</p>
<p><strong>Just colours and rules.</strong> Every bundled theme keeps its colours in CSS variables, so a few lines in <code>resources/<wbr>style.<wbr>css</code> go a long way:</p>
<div class="language-css vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">css</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">:root</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">--accent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">#b45309</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">; }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D">header</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">.masthead</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">border-bottom</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">6</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">px</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> solid</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> var</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">--accent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">); }</span></span></code></pre>
</div><figure>
  <img src="https://kitloom.dev/blog/child-themes/site.jpg" width="1600" height="1000" alt="A post on the Inkwell child theme: Journal's photo header and typography, with a thick amber rule under the header from the child's style.css." loading="lazy">
  <figcaption>Inkwell: Journal's templates and type, the child's accent and rule under the header.</figcaption>
</figure>
<h2 id="what-stays-the-parent-s" tabindex="-1">What stays the parent's <a class="header-anchor" href="#what-stays-the-parent-s" aria-label="Permalink to &quot;What stays the parent's&quot;">&ZeroWidthSpace;</a></h2>
<p>While a child is active, its parent counts as active too, just as WordPress loads both themes' <code>functions.<wbr>php</code>. Nothing the parent sets up is lost:</p>
<ul>
<li>its menu locations and widget zones, with the menus and widgets already in them;</li>
<li>its post types, with their admin screens in Filament and Nova;</li>
<li>the data its templates read, and its database tables — activating the child runs the parent's migrations first;</li>
<li>its translations, which the child's <code>lang/<wbr>*.<wbr>json</code> can override line by line;</li>
<li>its settings on Appearance → Customize. The first time the child is activated, it starts from the parent's values, so the colours and logo the owner picked stay. WordPress resets them instead.</li>
</ul>
<p>And when the parent is updated with <code>composer update</code>, the child gets every change it did not override.</p>
<h2 id="coming-from-a-wordpress-child-theme" tabindex="-1">Coming from a WordPress child theme <a class="header-anchor" href="#coming-from-a-wordpress-child-theme" aria-label="Permalink to &quot;Coming from a WordPress child theme&quot;">&ZeroWidthSpace;</a></h2>
<p>If you have built WordPress child themes, you already know how this works:</p>
<table tabindex="0">
<thead>
<tr>
<th>WordPress</th>
<th>kitloom</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Template:<wbr> parent</code> in <code>style.<wbr>css</code></td>
<td><code>extra.<wbr>kitloom.<wbr>theme.<wbr>parent</code> in <code>composer.<wbr>json</code></td>
</tr>
<tr>
<td>Child's <code>style.<wbr>css</code>, enqueued after the parent's</td>
<td><code>resources/<wbr>style.<wbr>css</code>, loaded after the parent's styles</td>
</tr>
<tr>
<td>A template file of the same name overrides the parent's</td>
<td>The same, by the same template hierarchy</td>
</tr>
<tr>
<td><code>get_<wbr>template_<wbr>part()</code> finds the child's part first</td>
<td><code>@include('partials.<wbr>x')</code> and <code>@/<wbr>Components/<wbr>X.<wbr>vue</code> find the child's first</td>
</tr>
<tr>
<td><code>get_<wbr>template_<wbr>directory()</code> for the parent's files</td>
<td><code>parent::</code> in Blade, <code>@parent/</code> in Vue and React</td>
</tr>
<tr>
<td>Both <code>functions.<wbr>php</code> files run</td>
<td>Both service providers boot; the parent's first</td>
</tr>
<tr>
<td><code>theme_<wbr>mods_<wbr>child</code>, starting empty</td>
<td><code>theme_<wbr>mods_<wbr>&lt;child&gt;</code>, starting from the parent's values</td>
</tr>
<tr>
<td>A grandchild theme is not supported</td>
<td>Not supported either</td>
</tr>
</tbody>
</table>
<h2 id="child-themes-and-seo" tabindex="-1">Child themes and SEO <a class="header-anchor" href="#child-themes-and-seo" aria-label="Permalink to &quot;Child themes and SEO&quot;">&ZeroWidthSpace;</a></h2>
<p>A theme switch is the kind of change that worries anyone responsible for search traffic. Moving from a parent theme to its child is about as safe as such a change gets, and the reasons are worth knowing.</p>
<p><strong>Addresses do not change.</strong> In kitloom, a page's URL comes from its content and the site's permalink settings, not from the theme. Switching to a child theme leaves every address, every redirect and the sitemap exactly as they were.</p>
<p><strong>Titles, descriptions and structured data do not come from the theme.</strong> The <code>seo</code> module puts the meta title, description, canonical address, Open Graph tags and schema.org markup into every page through <code>@site<wbr>Head</code> — with the values from Rank Math if the site came from WordPress. Every theme, parent or child, prints the same head.</p>
<p><strong>No extra requests.</strong> A Blade child's styles go into the page head with the parent's. A Vue or React child is one build: the parent's code and the child's overrides in a single bundle, with no extra stylesheet or script to load. The colours from Customize are a few CSS variables in the head, not a file.</p>
<p><strong>Previews stay out of the index.</strong> A Customize draft is drawn only for the person editing it, marked <code>noindex</code> and kept out of the page cache, so a half-finished colour scheme can never be crawled.</p>
<p><strong>You keep the parent's fixes.</strong> Performance and accessibility fixes in a theme update reach a child theme automatically. A forked theme would have to merge them by hand, and in practice often never does.</p>
<p>Before switching a live site, it is still worth checking:</p>
<ol>
<li><strong>Compare the pages that matter.</strong> Run the child on a staging copy and compare it with the live site using <a href="https://kitloom.dev/docs/migrate-from-wordpress.html#_3-compare-page-by-page"><code>compare-<wbr>sites.<wbr>php</code></a>: status codes, titles, descriptions, canonical addresses, headings and structured data, address by address.</li>
<li><strong>Keep one <code>&lt;h1&gt;</code> per page.</strong> If you override a template or a layout, check that you did not drop the page heading or add a second one.</li>
<li><strong>Run Lighthouse on a phone</strong> on the home page, a post and an archive, and compare with the parent. A child that only changes templates and colours should score the same.</li>
<li><strong>Clear the page cache</strong> after the switch, from Settings → Cache, so visitors get the new pages at once.</li>
</ol>
<h2 id="let-an-agent-do-the-colours" tabindex="-1">Let an agent do the colours <a class="header-anchor" href="#let-an-agent-do-the-colours" aria-label="Permalink to &quot;Let an agent do the colours&quot;">&ZeroWidthSpace;</a></h2>
<p>Settings are also open to AI agents. An agent connected to the site sees the active theme, its parent and its settings in <code>describe_<wbr>site</code>, and changes them with <code>theme_<wbr>customize</code>, as the user whose key it holds — &quot;make the accent darker and put our logo in the header&quot; without opening the admin. The values go through the same checks as the Customize screen, and the change is in the activity log.</p>
<h2 id="watch-it" tabindex="-1">Watch it <a class="header-anchor" href="#watch-it" aria-label="Permalink to &quot;Watch it&quot;">&ZeroWidthSpace;</a></h2>
<p>Two short lessons from the admin, narrated, about a minute and a half each:</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" src="https://media.kitloom.dev/lessons/site/filament/child-themes.mp4#t=3"></video>
  <figcaption>Child themes: a child of Blade on Appearance → Themes and on the site</figcaption>
</figure>
</div>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" src="https://media.kitloom.dev/lessons/site/filament/customize.mp4#t=3"></video>
  <figcaption>Customize: a colour, a font, the tagline and the footer, then Publish</figcaption>
</figure>
</div>
<h2 id="read-more" tabindex="-1">Read more <a class="header-anchor" href="#read-more" aria-label="Permalink to &quot;Read more&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><a href="https://kitloom.dev/docs/themes/child-themes.html">Child Themes</a> — every detail: Blade, Vue and React, packages, what a child inherits.</li>
<li><a href="https://kitloom.dev/docs/themes/customize.html">Theme Settings (Customize)</a> — for site owners and for theme authors declaring their own settings.</li>
<li><a href="https://kitloom.dev/docs/themes/catalog.html">Theme Catalog</a> — every bundled theme, each with a live demo, all of them ready to be a parent.</li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>kitloom vs Statamic: which Laravel CMS fits your site</title>
      <link>https://kitloom.dev/blog/kitloom-vs-statamic.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/kitloom-vs-statamic.html</guid>
      <pubDate>Thu, 22 Oct 2026 12:00:00 GMT</pubDate>
      <description>Statamic is a mature Laravel CMS with content in flat files. kitloom gives a new or WordPress site a ready data model, modules and an AI agent that runs it.</description>
      <content:encoded><![CDATA[<p>Statamic and kitloom are both CMSs installed into a Laravel application with Composer, both with an admin and templates in Blade. If you are choosing a Laravel CMS, you will look at both. They answer different questions, though: Statamic keeps content in files by default and leaves the content model to you, while kitloom gives a new site a ready data model, modules and an AI agent, and lets an existing WordPress site move in as it is. Here is where each one is the better choice.</p>
<h2 id="what-each-one-is" tabindex="-1">What each one is <a class="header-anchor" href="#what-each-one-is" aria-label="Permalink to &quot;What each one is&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Statamic</strong> is a Laravel CMS that has been around since 2012, now at version 6. A new site chooses at install whether content lives in flat files — Markdown and YAML that sit in git with the code — or in a database through the Eloquent Driver, and can switch later. It has its own control panel, the Bard editor with block sets, Live Preview, blueprints with more than 40 field types, forms, and templates in Antlers or Blade. Its addon marketplace is large: e-commerce, SEO, search and many more, some free and some paid. The Core edition is free, with one administrator and one form. Pro adds users and roles, revisions, multi-site and the REST and GraphQL APIs.</p>
<p><strong>kitloom</strong> is a Laravel CMS on the WordPress data model. A new site gets those tables from a migration, with no WordPress installed. Point it at an existing WordPress database and the same site answers at the same URLs, with the same users and their passwords, and with the plugins' data read in the plugins' own formats. There is no WordPress code inside. The models speak Laravel (<code>$post-<wbr>&gt;title</code>, <code>$post-<wbr>&gt;field('price')</code>, <code>Settings::<wbr>get()</code>), and requests are handled the way WordPress handles them: permalinks, the main query, the template hierarchy. On top of that it brings:</p>
<ul>
<li>an admin in Filament 5 or Laravel Nova 5;</li>
<li>over 50 modules, among them a shop, bookings, courses, listings, languages, SEO, redirects and forms;</li>
<li>14 themes in Blade, Vue or React;</li>
<li>an MCP server, so an AI agent can run the site with the rights you give it.</li>
</ul>
<h2 id="side-by-side" tabindex="-1">Side by side <a class="header-anchor" href="#side-by-side" aria-label="Permalink to &quot;Side by side&quot;">&ZeroWidthSpace;</a></h2>
<table tabindex="0">
<thead>
<tr>
<th></th>
<th>Statamic</th>
<th>kitloom</th>
</tr>
</thead>
<tbody>
<tr>
<td>Where content lives</td>
<td>Flat files (Markdown, YAML) or a database through the Eloquent Driver, chosen at install or switched later</td>
<td>The WordPress data model in a database: a new one, or the one WordPress left</td>
</tr>
<tr>
<td>Coming from WordPress</td>
<td>The free official Importer brings entries, terms and users from XML or CSV, with special handling of Gutenberg content; you map the fields and build the templates and routes yourself</td>
<td>Nothing to import: the same URLs, users who sign in with their passwords, and ACF, Contact Form 7, Flamingo, WooCommerce and Rank Math data read in place; Yoast SEO and Redirection come over with one command. You can rehearse the move on the live database first</td>
</tr>
<tr>
<td>Admin</td>
<td>Statamic's own control panel</td>
<td>Filament 5 or Laravel Nova 5, with the same modules in each</td>
</tr>
<tr>
<td>Editing</td>
<td>Bard with block sets, Live Preview</td>
<td>A visual editor; existing Gutenberg blocks are drawn, there is no block editor for new content</td>
</tr>
<tr>
<td>Front end</td>
<td>Antlers or Blade; REST and GraphQL in Pro</td>
<td>Blade, Vue or React themes; every page as JSON, and the <code>wp/<wbr>v2</code> REST API</td>
</tr>
<tr>
<td>Shop, bookings, courses</td>
<td>Addons from the marketplace, such as Cargo for a shop ($199, then $85 a year)</td>
<td>Modules included: shop, bookings, courses, listings</td>
</tr>
<tr>
<td>AI agents (MCP)</td>
<td>No first-party MCP server; community addons such as <code>cboxdk/<wbr>statamic-<wbr>mcp</code> and <code>danielgnh/<wbr>statamic-<wbr>mcp</code></td>
<td>Built in (<code>kitloom/<wbr>ai</code>): an agent connects to <code>/<wbr>mcp</code> and works on content, media, settings and every installed module, with the rights of the key's user; locked settings, nothing deleted for good, every change in the activity log</td>
</tr>
<tr>
<td>Requirements</td>
<td>PHP 8.3, Laravel</td>
<td>PHP 8.4, Laravel 13, a database: MySQL or MariaDB on a server, SQLite for tests and sandboxes</td>
</tr>
<tr>
<td>Price</td>
<td>Core free; Pro $349 per site with a year of updates, then $99 a year; free while in development</td>
<td>$299 for one site, with a year of every update and new module; after it the modules you have keep their updates free and only later modules need a renewal; one admin per license, Filament or Nova</td>
</tr>
<tr>
<td>Age</td>
<td>Since 2012, with a large community, addon authors and agencies</td>
<td>Version 1 in October 2026, a small community</td>
</tr>
</tbody>
</table>
<h2 id="when-statamic-is-the-better-choice" tabindex="-1">When Statamic is the better choice <a class="header-anchor" href="#when-statamic-is-the-better-choice" aria-label="Permalink to &quot;When Statamic is the better choice&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>You want content in git.</strong> By default, content is Markdown and YAML files, so it goes through the same review and deploy as the code, and the server needs no database. kitloom always needs one.</li>
<li><strong>The editor matters most.</strong> Bard, block sets and Live Preview are what Statamic is known for. kitloom has a visual editor, flexible content fields and shortcodes, but no block editor.</li>
<li><strong>You need one admin and no budget.</strong> Statamic Core is free for one administrator and one form. kitloom has no free edition: you see everything in the demos first, and there is a 14-day refund.</li>
<li><strong>You want a mature ecosystem.</strong> Statamic has been around since 2012, with over 500 addons, plus tutorials and agencies that know it. kitloom reached version 1 in October 2026.</li>
<li><strong>You don't want the WordPress data model.</strong> kitloom's content lives in posts, meta and terms, on MySQL or MariaDB. Statamic has you shape blueprints around the site.</li>
</ul>
<h2 id="when-kitloom-is" tabindex="-1">When kitloom is <a class="header-anchor" href="#when-kitloom-is" aria-label="Permalink to &quot;When kitloom is&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>An AI agent runs the site, under your control.</strong> kitloom ships an MCP server, not an addon. Claude, Cursor or your own agent connects to <code>/<wbr>mcp</code>, calls <code>describe_<wbr>site</code> first, then does the work through the same code as the admin: <code>create_<wbr>content</code> and <code>update_<wbr>content</code> for posts and pages, <code>upload_<wbr>media</code>, <code>menu_<wbr>save</code>, <code>product_<wbr>save</code> and <code>orders_<wbr>list</code>, and the tools of SEO, redirects, forms, bookings, courses and translations. Ask it to &quot;draft three posts from these notes and put them in the Guides category&quot;, or to &quot;fill in the SEO descriptions of the products that have none&quot;. It acts as the user whose key it holds: an author's key writes drafts, a read-only key only reads. The settings that decide who gets in or what code runs on every page are locked, <code>trash_<wbr>content</code> is the only way out of a record and <code>restore_<wbr>content</code> brings it back, every change goes into the activity log, and revoking the key stops it at once. See <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</li>
<li><strong>You are starting a new site and want it working today.</strong> One command asks which theme and modules you need and can fill the site with demo content. Post types and 37 kinds of custom fields are made in the admin, with no code, and editors find familiar screens. No WordPress is installed.</li>
<li><strong>The site is on WordPress now.</strong> Every URL keeps working, users keep their passwords, and the plugins' data keeps working, not just reads: a Contact Form 7 form still sends, WooCommerce orders can still be refunded, Rank Math's redirects still redirect, and Redirection's rules come over with one command. With Statamic that is an import, routes and redirects to rebuild, and plugin behaviour to find addons for. See <a href="https://kitloom.dev/blog/migrate-wordpress-to-laravel.html">Migrate WordPress to Laravel without moving the content</a> and <a href="https://kitloom.dev/blog/wordpress-alternative.html">WordPress alternative: a Laravel CMS that keeps your site</a>.</li>
<li><strong>You need more than one user.</strong> Roles, revisions, the REST API and languages come with the $299 license (Nova needs a license of its own; Filament is free). In Statamic, users, roles, revisions and the APIs need Pro, at $349 per site.</li>
<li><strong>The site sells, books or teaches.</strong> The shop, bookings, courses and listings are modules of the same product, tested together, with admins in Filament and Nova. In Statamic each is an addon, often from another author and with its own license.</li>
<li><strong>Your team works in Filament or Nova already.</strong> The admin is the one they know, and a module's screens are ordinary Filament resources or Nova resources they can extend. If you only need part of a site in a Filament panel, see <a href="https://kitloom.dev/blog/laravel-filament-plugins-for-a-website.html">Laravel Filament plugins for a full website</a>.</li>
</ul>
<h2 id="try-both" tabindex="-1">Try both <a class="header-anchor" href="#try-both" aria-label="Permalink to &quot;Try both&quot;">&ZeroWidthSpace;</a></h2>
<p>Statamic's Core is free: install it with Composer from <a href="https://statamic.com" target="_blank" rel="noreferrer">statamic.com</a> and build a site.</p>
<p>For kitloom, open a sandbox in one click, no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament demo</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova demo</a>. Connect an agent to it from the dashboard and give it something to do. Then follow <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a> on your own data, starting read-only. Prices and the refund are on <a href="https://kitloom.dev/pricing.html">Pricing</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Use ACF fields in Laravel: keep Advanced Custom Fields data</title>
      <link>https://kitloom.dev/blog/acf-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/acf-in-laravel.html</guid>
      <pubDate>Wed, 21 Oct 2026 12:00:00 GMT</pubDate>
      <description>Use Advanced Custom Fields data in Laravel as ACF left it: kitloom/custom-fields reads ACF's field groups and values, all 37 field types, with no export.</description>
      <content:encoded><![CDATA[<p>On many WordPress sites, the content that matters most is not in the post body. It is in Advanced Custom Fields: a book's ISBN, a team member's photo, a page's hero section, a repeater of quotes, flexible content that builds a whole landing page.</p>
<p>ACF has its own way of storing all of that:</p>
<ul>
<li><strong>Field groups and fields</strong> are posts of type <code>acf-<wbr>field-<wbr>group</code> and <code>acf-<wbr>field</code>, with their settings in <code>post_<wbr>content</code> and their location rules (&quot;show this group on books&quot;).</li>
<li><strong>Values</strong> sit in <code>postmeta</code>, <code>termmeta</code> or <code>usermeta</code> under the field's name, with a reference beside each one: <code>_<wbr>{name}</code> holds the field key.</li>
<li><strong>A repeater</strong> keeps its row count under its name, and each row's values as <code>{repeater}_<wbr>{row}_<wbr>{sub}</code>. A group's sub fields are <code>{group}_<wbr>{sub}</code>. Flexible content keeps a list of its row layouts.</li>
<li><strong>Options pages</strong> keep their values in <code>wp_<wbr>options</code> as <code>options_<wbr>{name}</code>.</li>
</ul>
<p>A usual Laravel rebuild turns this into columns or a JSON blob, so someone has to decode the repeater rows, guess the types and write an importer. The editors lose the forms they knew: field groups, location rules, conditional logic. And every template that called <code>get_<wbr>field()</code> is rewritten against the new schema.</p>
<h2 id="how-kitloom-reads-it" tabindex="-1">How kitloom reads it <a class="header-anchor" href="#how-kitloom-reads-it" aria-label="Permalink to &quot;How kitloom reads it&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom runs on the WordPress database as it is. <code>kitloom/<wbr>custom-<wbr>fields</code> uses ACF's layout as its data model. It reads field groups and fields as the plugin stores them, with their location rules and conditional logic. It reads values under the same meta keys and writes them back in the same places. Data stored by Secure Custom Fields, the free fork, is read the same way.</p>
<p>All 37 field types are covered, PRO ones included:</p>
<table tabindex="0">
<thead>
<tr>
<th>Category</th>
<th>Types</th>
</tr>
</thead>
<tbody>
<tr>
<td>Basic</td>
<td>text, textarea, number, range, email, url, password</td>
</tr>
<tr>
<td>Content</td>
<td>image, file, wysiwyg, oembed, gallery</td>
</tr>
<tr>
<td>Choice</td>
<td>select, checkbox, radio, button_group, true_false, nav_menu</td>
</tr>
<tr>
<td>Relational</td>
<td>link, post_object, page_link, relationship, taxonomy, user</td>
</tr>
<tr>
<td>Advanced</td>
<td>google_map, date_picker, date_time_picker, time_picker, color_picker, icon_picker</td>
</tr>
<tr>
<td>Layout</td>
<td>message, accordion, tab, group, repeater, flexible_content, clone</td>
</tr>
</tbody>
</table>
<p>In a theme or any Laravel code, a value is one call:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">field</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'subtitle'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);               </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// 'Under the title'</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$post</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">field</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'slides'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);                 </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// [['caption' => 'One'], ['caption' => 'Two']]</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Kitloom\CustomFields\Facades\Fields</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Fields</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">option</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'footer_text'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);          </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// a value of the options screen</span></span></code></pre>
</div><p>Values come back the way <code>get_<wbr>field($name, $post, false)</code> returns them: ids stay ids, a repeater is a list of rows, a flexible content row carries <code>acf_<wbr>fc_<wbr>layout</code>. Writing goes through the same checks as the form. <code>$post-<wbr>&gt;set<wbr>Field('subtitle', 'Under the title')</code> checks required fields, choices, ranges and conditional logic. Given a user, as in <code>$post-<wbr>&gt;set<wbr>Fields([...<wbr>], $user)</code>, it also refuses a write that user may not make.</p>
<p>Post types and taxonomies made with ACF come along too. <code>kitloom/<wbr>post-<wbr>types</code> reads them from their <code>acf-<wbr>post-<wbr>type</code> and <code>acf-<wbr>taxonomy</code> posts, so their archives and single pages answer at the same addresses.</p>
<h2 id="what-the-admin-shows" tabindex="-1">What the admin shows <a class="header-anchor" href="#what-the-admin-shows" aria-label="Permalink to &quot;What the admin shows&quot;">&ZeroWidthSpace;</a></h2>
<p>Both admins have a <strong>Custom Fields</strong> section with <strong>Field Groups</strong> and <strong>Add New Field Group</strong>, as in the plugin's menu. A group has its title, fields, location rules, style, label and instruction placement and order. Each field has a label, a name, a type with that type's settings, instructions, required and conditional logic.</p>
<ul>
<li><strong>Filament</strong> edits a group's fields on the group's form, nested a few levels, as the plugin's editor does. A record's form shows the matching groups in a <strong>Custom Fields</strong> block on post, term and user forms. A repeater is a Repeater, flexible content a Builder with a block per layout.</li>
<li><strong>Nova</strong> edits fields one by one, because a single form holding every type's settings at every level would weigh megabytes in the browser. A <strong>Custom Fields</strong> tab on post and taxonomy forms shows the matching groups, with repeaters and flexible content as rows.</li>
</ul>
<p>In both, image, file and gallery fields open the media library, and wysiwyg fields use the site's visual editor (TinyMCE). The screens need the <code>manage_<wbr>field_<wbr>groups</code> permission, which administrators have.</p>
<p>With <code>kitloom/<wbr>languages</code>, text fields follow the page's language. With <code>kitloom/<wbr>ai</code>, an agent reads a record's fields with their types and values (<code>fields_<wbr>get</code>) and sets them (<code>fields_<wbr>set</code>), checked as the form checks them and only where its user may edit the record.</p>
<h2 id="what-changes-and-what-is-not-covered" tabindex="-1">What changes and what is not covered <a class="header-anchor" href="#what-changes-and-what-is-not-covered" aria-label="Permalink to &quot;What changes and what is not covered&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>The move is one way.</strong> Lists and maps kitloom writes are JSON. What ACF serialized is read as it is, never as PHP objects, and becomes JSON on its next save. ACF on WordPress would not read those values back.</li>
<li><strong>Groups have to be in the database.</strong> kitloom reads field groups from their posts. A group that only ever lived in PHP (<code>acf_<wbr>add_<wbr>local_<wbr>field_<wbr>group()</code>) or in <code>acf-<wbr>json</code> files is not there to read. <code>Group<wbr>Writer</code> takes the array ACF exports to JSON, so such a group can be saved once. Its values are in meta already.</li>
<li><strong>Not here yet</strong>: the options pages screen (the values are stored and read already), ACF blocks, bidirectional relationships, and fields in REST output.</li>
<li><strong>The plugin's Position setting</strong> (after the title, in the side column) has no counterpart on these forms. A group keeps the value it had.</li>
<li><strong>Plugin code does not run.</strong> Templates that call <code>get_<wbr>field()</code> are rewritten in a kitloom theme with <code>$post-<wbr>&gt;field()</code>. There is no Gutenberg in the admin, and ACF blocks in content are not drawn yet.</li>
</ul>
<h2 id="fill-and-fix-fields-with-an-ai-agent" tabindex="-1">Fill and fix fields with an AI agent <a class="header-anchor" href="#fill-and-fix-fields-with-an-ai-agent" aria-label="Permalink to &quot;Fill and fix fields with an AI agent&quot;">&ZeroWidthSpace;</a></h2>
<p>With <code>kitloom/<wbr>ai</code> installed, an agent connected to the site knows the field groups before it touches anything: <code>describe_<wbr>site</code> tells it which groups show on which post types. It reads a record's fields with their types (<code>fields_<wbr>get</code>) and writes them (<code>fields_<wbr>set</code>), checked exactly as the edit form checks them, so a wrong value is refused rather than stored. That turns field work that took an afternoon of clicking into one request:</p>
<ul>
<li><em>&quot;Fill the servings and preparation time fields of every recipe from its text.&quot;</em></li>
<li><em>&quot;Find the projects whose client field is empty and tell me which they are.&quot;</em></li>
<li><em>&quot;Copy the subtitle into the new summary field on every case study, shortened to one sentence.&quot;</em></li>
</ul>
<p>The agent works as the user whose key it holds and may only change records that user may edit. Every change is in the activity log. How to connect one: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="check-it-on-your-own-site" tabindex="-1">Check it on your own site <a class="header-anchor" href="#check-it-on-your-own-site" aria-label="Permalink to &quot;Check it on your own site&quot;">&ZeroWidthSpace;</a></h2>
<p>Create a MySQL user that can only read, point kitloom at the live database, and look at your pages. Then run <code>compare-<wbr>sites.<wbr>php</code> against both sites. It compares status codes, titles, content and lists address by address, and it flags block comments that reached kitloom's page undrawn, such as ACF blocks. How fields are laid out on a page is the theme's work, so look at your field-heavy templates yourself or let an AI agent go through them. Signing in to the admin needs a copy of the database. The steps are in <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a>, and the details of storage are in the <a href="https://kitloom.dev/docs/modules/guides/custom-fields.html">Custom Fields guide</a>.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. When it fits, see <a href="https://kitloom.dev/pricing.html">Pricing</a>.</p>
<p>ACF rarely comes alone. The same approach covers <a href="https://kitloom.dev/blog/woocommerce-to-laravel.html">WooCommerce</a>, <a href="https://kitloom.dev/blog/contact-form-7-in-laravel.html">Contact Form 7 and Flamingo</a> and <a href="https://kitloom.dev/blog/rank-math-in-laravel.html">Rank Math</a>. An overview is in <a href="https://kitloom.dev/blog/plugin-data-after-the-move.html">your plugin data after moving to Laravel</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Contact Form 7 in Laravel: keep forms and Flamingo messages</title>
      <link>https://kitloom.dev/blog/contact-form-7-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/contact-form-7-in-laravel.html</guid>
      <pubDate>Wed, 21 Oct 2026 12:00:00 GMT</pubDate>
      <description>Contact Form 7 forms and Flamingo messages in Laravel: kitloom/forms reads both as the plugins left them, so forms, shortcodes and years of messages keep working.</description>
      <content:encoded><![CDATA[<p>A contact form looks like a small thing to move. On a real site it rarely is. There are several forms, each with its own fields, mail templates and messages, and a shortcode in every page that shows one. With Flamingo installed, there are also years of messages that people sent through them.</p>
<p>Here is where the two plugins keep it all:</p>
<ul>
<li><strong>A form</strong> is a <code>wpcf7_<wbr>contact_<wbr>form</code> post. Its template (<code>[text* your-<wbr>name]</code> and the rest) is in the <code>_<wbr>form</code> meta. The two mails are in <code>_<wbr>mail</code> and <code>_<wbr>mail_<wbr>2</code>, the texts a visitor sees in <code>_<wbr>messages</code>, the extra options in <code>_<wbr>additional_<wbr>settings</code>, and the hash a shortcode finds it by in <code>_<wbr>hash</code>.</li>
<li><strong>A page</strong> shows a form with <code>[contact-<wbr>form-<wbr>7 id=&quot;1a2b3c4&quot;]</code> in its content.</li>
<li><strong>A message</strong> Flamingo kept is a <code>flamingo_<wbr>inbound</code> post, with a <code>_<wbr>field_<wbr>&lt;name&gt;</code> meta per field, plus <code>_<wbr>from</code>, <code>_<wbr>subject</code> and <code>_<wbr>meta</code> (IP, browser, page, date). The form it came from is its <code>flamingo_<wbr>inbound_<wbr>channel</code> term.</li>
</ul>
<p>A usual Laravel rebuild writes the forms again in code or in a form builder. Their mail templates and messages are typed in again by hand. The shortcodes in old pages show up as plain text, and the messages end up in a CSV export, or nowhere.</p>
<h2 id="how-kitloom-reads-it" tabindex="-1">How kitloom reads it <a class="header-anchor" href="#how-kitloom-reads-it" aria-label="Permalink to &quot;How kitloom reads it&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom runs on the WordPress database as it is. <code>kitloom/<wbr>forms</code> reads forms where Contact Form 7 keeps them and messages where Flamingo keeps them, and needs no table of its own.</p>
<ul>
<li><strong>Shortcodes keep working.</strong> <code>[contact-<wbr>form-<wbr>7 id=&quot;…&quot;]</code> finds the form by the start of its hash or by its post ID, and the older <code>[contact-<wbr>form id=&quot;12&quot;]</code> works too. The theme gets the form's template with each form-tag as a field to draw: text, email, URL, telephone, number, date, textarea, select, checkbox, radio, acceptance and submit.</li>
<li><strong>The same submit address.</strong> The form posts to <code>/<wbr>wp-<wbr>json/<wbr>contact-<wbr>form-<wbr>7/<wbr>v1/<wbr>contact-<wbr>forms/<wbr>{id}/<wbr>feedback</code>, the plugin's own route, and gets the plugin's JSON answer: <code>mail_<wbr>sent</code>, <code>validation_<wbr>failed</code>, <code>spam</code> or <code>mail_<wbr>failed</code>, with the invalid fields.</li>
<li><strong>Validation</strong> checks each field against its tag (required, email, URL, ranges, length, the choices the form offers) and keeps only the form's own fields.</li>
<li><strong>Messages</strong> are stored as Flamingo's, under the form they came from. Old messages are there as before.</li>
<li><strong>Mail</strong> goes out through Laravel's mailer and queue, with the mail-tags filled in: <code>[your-<wbr>name]</code>, <code>[_<wbr>site_<wbr>title]</code>, <code>[_<wbr>date]</code>, <code>[_<wbr>url]</code> and the rest.</li>
<li><strong>Additional settings</strong> that change behaviour are followed: <code>skip_<wbr>mail:<wbr> on</code>, <code>do_<wbr>not_<wbr>store:<wbr> true</code>, <code>demo_<wbr>mode:<wbr> on</code>.</li>
</ul>
<p>Spam protection is built in. A honeypot is on by default, Cloudflare Turnstile is on once its keys are set, and one address may send 10 submissions a minute by default. The same checks guard the site's comment form.</p>
<h2 id="what-the-admin-shows" tabindex="-1">What the admin shows <a class="header-anchor" href="#what-the-admin-shows" aria-label="Permalink to &quot;What the admin shows&quot;">&ZeroWidthSpace;</a></h2>
<p>Filament has a <strong>Contact</strong> section and Nova a <strong>Contact Forms</strong> section, each with All Forms, Add New Form, Messages and Settings. A form has Contact Form 7's tabs: Form (the template with its form-tags and the shortcode to copy), Mail and Mail (2), Messages (the texts a visitor sees) and Additional Settings. A new form starts from the plugin's default template and mail.</p>
<p>Messages lists what the forms received, newest first and without spam, with a filter by form. A message opens read-only, with its fields and where it was sent from. Deleting moves it to the trash. Settings holds the spam protection: the honeypot, the limit per minute and the Turnstile keys, with the secret stored encrypted.</p>
<p>Administrators and editors manage forms and read messages (<code>manage_<wbr>contact_<wbr>forms</code>, <code>read_<wbr>contact_<wbr>messages</code>). Only administrators open Settings.</p>
<p>A few modules plug in here when they are installed:</p>
<ul>
<li><strong><code>kitloom/<wbr>languages</code></strong>: a form follows the page's language through its Translations tab.</li>
<li><strong><code>kitloom/<wbr>ai</code></strong>: an agent lists forms and messages, changes a form's template and marks a message as spam or not. It deletes nothing.</li>
<li><strong><code>kitloom/<wbr>privacy</code></strong>: WordPress's Export and Erase Personal Data screens include the messages a person sent.</li>
</ul>
<h2 id="what-changes-and-what-is-not-covered" tabindex="-1">What changes and what is not covered <a class="header-anchor" href="#what-changes-and-what-is-not-covered" aria-label="Permalink to &quot;What changes and what is not covered&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>The move is one way.</strong> Arrays are written as JSON and the serialized ones are read too. Contact Form 7 on WordPress would not read the JSON back.</li>
<li><strong>Some form-tags stay as text.</strong> <code>[file]</code> and <code>[quiz]</code> are not drawn, so a form that takes file uploads needs another way to do it. The same goes for tags added by other plugins.</li>
<li><strong>Spam protection is kitloom's own</strong>: the honeypot and Turnstile. Spam services set up for the plugin in WordPress are not read.</li>
<li><strong>Flamingo's address book</strong> (its list of contacts) is not read. The messages are.</li>
<li><strong>Mail needs Laravel's settings.</strong> Set <code>MAIL_<wbr>*</code> in <code>.<wbr>env</code>, and run a queue worker when the queue is not <code>sync</code>, or nothing is sent.</li>
<li><strong>Plugin code does not run.</strong> Contact Form 7's own scripts and markup are not used. The theme draws the form from its data. Of the bundled themes, Journal, Bureau, Portfolio, Pantry and Blade draw it; Marketplace and Game Reviews do not.</li>
</ul>
<p>The complete list of what is read is in the <a href="https://kitloom.dev/docs/modules/guides/forms.html">Forms guide</a>.</p>
<h2 id="read-and-answer-messages-with-an-ai-agent" tabindex="-1">Read and answer messages with an AI agent <a class="header-anchor" href="#read-and-answer-messages-with-an-ai-agent" aria-label="Permalink to &quot;Read and answer messages with an AI agent&quot;">&ZeroWidthSpace;</a></h2>
<p>Years of Flamingo messages are only useful if someone reads them. With <code>kitloom/<wbr>ai</code> installed, an agent connected to the site lists the forms (<code>forms_<wbr>list</code>, <code>form_<wbr>get</code>), reads their messages (<code>submissions_<wbr>list</code>), marks spam (<code>submission_<wbr>spam</code>) and changes a form's template (<code>form_<wbr>update</code>). You ask:</p>
<ul>
<li><em>&quot;Summarise this week's messages from the contact form and list the ones that ask for a quote.&quot;</em></li>
<li><em>&quot;Mark the obvious spam from the last month as spam.&quot;</em></li>
<li><em>&quot;Add a phone field to the quote form, optional, after the email.&quot;</em></li>
</ul>
<p>The agent acts as the user whose key it holds, sees messages only if that user may, and deletes nothing. The mail settings that decide where messages go stay locked to people. How to connect one: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="check-it-on-your-own-site" tabindex="-1">Check it on your own site <a class="header-anchor" href="#check-it-on-your-own-site" aria-label="Permalink to &quot;Check it on your own site&quot;">&ZeroWidthSpace;</a></h2>
<p>Create a MySQL user that can only read, point kitloom at the live database, and look at your contact pages. Then run <code>compare-<wbr>sites.<wbr>php</code> against both sites. Among its checks, it flags any <code>[shortcode]</code> that reached kitloom's page undrawn.</p>
<p>Sending a form writes to the database, so try it on a copy. Load the copy, run <code>php artisan migrate</code>, set the mail settings and send a test message from each form. It should show in Messages, under its form, next to the ones Flamingo kept. The steps are in <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a>.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. When it fits, see <a href="https://kitloom.dev/pricing.html">Pricing</a>.</p>
<p>Forms are one plugin among several. The same approach covers <a href="https://kitloom.dev/blog/woocommerce-to-laravel.html">WooCommerce</a>, <a href="https://kitloom.dev/blog/acf-in-laravel.html">ACF fields</a> and <a href="https://kitloom.dev/blog/rank-math-in-laravel.html">Rank Math</a>. An overview is in <a href="https://kitloom.dev/blog/plugin-data-after-the-move.html">your plugin data after moving to Laravel</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>How kitloom is tested: 4,700 tests, two admins and a video lesson for every screen</title>
      <link>https://kitloom.dev/blog/how-kitloom-is-tested.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/how-kitloom-is-tested.html</guid>
      <pubDate>Wed, 21 Oct 2026 12:00:00 GMT</pubDate>
      <description>Every kitloom package carries its own tests, both skeletons test how the packages fit together, every module's README describes what it does, and the video lessons drive the real admin once more.</description>
      <content:encoded><![CDATA[<p>A CMS that takes over a WordPress site is trusted with years of somebody's content, orders and users. It is also trusted with an AI agent that writes to that site. So &quot;it works on my machine&quot; is not enough, and neither is a demo. Here is what checks kitloom before a release, with the actual numbers as of this week.</p>
<h2 id="every-package-tests-itself" tabindex="-1">Every package tests itself <a class="header-anchor" href="#every-package-tests-itself" aria-label="Permalink to &quot;Every package tests itself&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom is 167 Composer packages: the core, every module with its Filament and Nova admins, and the themes. 164 of them have a test suite of their own, inside the package. A buyer who installs only some modules still gets their tests, and each package's split repository carries them too.</p>
<p>Together the packages hold <strong>4,412 tests</strong>. The largest suites are where the most can go wrong:</p>
<table tabindex="0">
<thead>
<tr>
<th>Package</th>
<th>Tests</th>
<th>What they cover</th>
</tr>
</thead>
<tbody>
<tr>
<td>Shop</td>
<td>426</td>
<td>Cart, taxes, coupons, shipping, stock, orders in WooCommerce's tables, the account pages</td>
</tr>
<tr>
<td>Site</td>
<td>362</td>
<td>Rewrite rules, the main query, canonical redirects, the template hierarchy, sessions and forms</td>
</tr>
<tr>
<td>WordPress data model</td>
<td>200</td>
<td>Posts, terms, users, meta and options, serialized and JSON values, visibility</td>
</tr>
<tr>
<td>Languages</td>
<td>185</td>
<td>Translations laid over the original, per-language URLs and slugs, conversion from Polylang and WPML</td>
</tr>
<tr>
<td>SEO</td>
<td>107</td>
<td>Titles and meta in Rank Math's format, sitemaps, robots.txt, instant indexing</td>
</tr>
<tr>
<td>Media</td>
<td>106</td>
<td>Uploads, image sizes, the library, old <code>/<wbr>wp-<wbr>content/<wbr>uploads/</code> links</td>
</tr>
</tbody>
</table>
<p>The tests come in a few kinds:</p>
<ul>
<li><strong>Tests on the WordPress tables.</strong> Rows are written exactly as WordPress leaves them, and the tests check that kitloom reads them the same way. They run in an in-memory database, so they are fast.</li>
<li><strong>Tests on real plugin data.</strong> 58 fixture files hold rows exactly as the plugins wrote them: every field type as Secure Custom Fields stores it, Rank Math's serialized redirect rules, WooCommerce's orders, and more. A module is tested against what the plugin really leaves behind, not against what we think it leaves.</li>
<li><strong>Tests of the whole application.</strong> These boot a real kitloom site and send requests to it, as a visitor and as each role.</li>
<li><strong>Tests of both admins.</strong> 102 test files drive Filament screens and 101 drive Nova screens: forms save, lists filter, a role that may not open a screen doesn't see it.</li>
<li><strong>Tests of the AI agent's tools.</strong> 21 modules test their MCP tools directly. On top of that, the agent server's own suite checks the rules every tool shares: a read-only key gets the reading tools only, the writers refuse what the key's user may not do, an author's agent sees only its own drafts, locked settings are reported as locked, and &quot;delete&quot; means the trash. Control over the agent is kitloom's main promise, so it is tested where it is made.</li>
<li><strong>Tests of the words.</strong> 24 packages check that their translation files match the texts in the code, so a new message never ships untranslated.</li>
<li><strong>Tests of the themes.</strong> 14 themes run their demo in a test: every widget zone is filled, every menu location has a menu, and the pages draw.</li>
</ul>
<h2 id="the-skeletons-test-how-it-fits-together" tabindex="-1">The skeletons test how it fits together <a class="header-anchor" href="#the-skeletons-test-how-it-fits-together" aria-label="Permalink to &quot;The skeletons test how it fits together&quot;">&ZeroWidthSpace;</a></h2>
<p>A package can pass on its own and still clash with another one. So the two applications kitloom is installed from, the Filament skeleton and the Nova skeleton, run every package's suite inside a real application, with all the modules installed together. They also have tests of their own: 185 in the Filament skeleton and 143 in the Nova one. Those cover the installer, the wiring between modules and the menus of the admin.</p>
<p>Altogether that is over <strong>4,700 tests</strong>. A full check runs them about <strong>7,400 times</strong>, because the domain packages run once under each admin: 3,795 test runs in the Filament skeleton and 3,648 in the Nova one. Each suite runs in parallel, a process per CPU core, and takes about a minute. The suites pass on SQLite and on MySQL with the WordPress table prefix, which is how most real sites run.</p>
<h2 id="before-the-tests-the-repository-checks" tabindex="-1">Before the tests: the repository checks <a class="header-anchor" href="#before-the-tests-the-repository-checks" aria-label="Permalink to &quot;Before the tests: the repository checks&quot;">&ZeroWidthSpace;</a></h2>
<p><code>tools/<wbr>check.<wbr>sh</code> runs before every release. Before the tests it checks:</p>
<ul>
<li>that every kitloom package a package uses is declared in its <code>composer.<wbr>json</code>;</li>
<li>that namespaces match file paths;</li>
<li>that the skeletons' own tests import only the core, so a module's test lives in the module;</li>
<li>the license fields of every package;</li>
<li>that every package requires the others at the same version;</li>
<li>code style with Pint;</li>
<li>static analysis with PHPStan, where new code may not add a single error to the baseline.</li>
</ul>
<h2 id="compared-with-a-real-woocommerce-store-on-the-same-data" tabindex="-1">Compared with a real WooCommerce store, on the same data <a class="header-anchor" href="#compared-with-a-real-woocommerce-store-on-the-same-data" aria-label="Permalink to &quot;Compared with a real WooCommerce store, on the same data&quot;">&ZeroWidthSpace;</a></h2>
<p>Some behaviour can only be judged next to the original. For the shop, a separate suite runs 29 scenarios on a real WooCommerce store and on kitloom over the same data: coupons, taxes, rounding, shipping, stock. It compares the totals and the orders written. When a number differs, kitloom is fixed, not the scenario.</p>
<p>For your own site, the same idea is a script you run yourself. <code>compare-<wbr>sites.<wbr>php</code> reads your WordPress and kitloom address by address and reports every difference in status, redirect, title, canonical tag and content. See <a href="https://kitloom.dev/blog/rehearse-the-move.html">Test a WordPress to Laravel migration on the live database</a>.</p>
<h2 id="every-module-describes-what-it-does" tabindex="-1">Every module describes what it does <a class="header-anchor" href="#every-module-describes-what-it-does" aria-label="Permalink to &quot;Every module describes what it does&quot;">&ZeroWidthSpace;</a></h2>
<p>Each package has a README, 166 of them. A module's README is not only for developers. It is the module's <strong>How it works</strong> page in the admin, so the person who configures a site reads the same text the code was checked against: what each screen does, where the data is kept, which WordPress plugin's data it reads, and what it does not do yet. The module guides at <a href="https://kitloom.dev/docs/modules/catalog.html">kitloom.dev</a> are built from the same READMEs.</p>
<h2 id="the-video-lessons-test-the-admin-once-more" tabindex="-1">The video lessons test the admin once more <a class="header-anchor" href="#the-video-lessons-test-the-admin-once-more" aria-label="Permalink to &quot;The video lessons test the admin once more&quot;">&ZeroWidthSpace;</a></h2>
<p>The <a href="https://kitloom.dev/docs/video-lessons.html">video lessons</a> are not screen recordings made by hand. Each one is a script, 90 of them across 34 modules and themes. It drives the real admin in a browser, as a person would: it signs in, opens the screen, fills the fields and saves, while a voice reads the narration. Every step has to find what it clicks or types into. If a button moved or a screen broke, the lesson stops with an error before any video is made. A check mode plays the same steps without recording, in seconds.</p>
<p>They found real problems. The first time the lessons were written, they turned up 31 admin defects the tests had not caught, such as a date format the settings form refused to save and a counter that showed a stale number. Each one went on the fix list. The 75 videos published today are the screens as they are now, including what an AI agent does through them.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>None of this proves kitloom fits your site, but it's why you can check that yourself without risk. Open a sandbox with every module and theme in one click, <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. Or look at your own WordPress site through kitloom with a read-only database user, as <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a> shows.</p>
]]></content:encoded>
    </item>
    <item>
      <title>kitloom vs Corcel: a Corcel alternative that retires WordPress</title>
      <link>https://kitloom.dev/blog/kitloom-vs-corcel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/kitloom-vs-corcel.html</guid>
      <pubDate>Wed, 21 Oct 2026 12:00:00 GMT</pubDate>
      <description>Corcel puts Eloquent models over the WordPress tables and keeps WordPress as the admin. kitloom, a Corcel alternative, adds the site, the admin and the plugins' data.</description>
      <content:encoded><![CDATA[<p>If you are a Laravel developer with a WordPress database in front of you, you have probably met Corcel. It does one thing and does it plainly: Eloquent models for WordPress's tables, so <code>Post::<wbr>published()-<wbr>&gt;get()</code> works in a Laravel app. kitloom starts from the same idea. The difference is everything that comes after the models: who edits the content, who answers the URLs, and what happens to WordPress.</p>
<h2 id="what-each-one-is" tabindex="-1">What each one is <a class="header-anchor" href="#what-each-one-is" aria-label="Permalink to &quot;What each one is&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Corcel</strong> is a collection of model classes that read the WordPress database, built on Eloquent. Its README describes the intended setup: WordPress stays the back end, the admin panel where posts are written, and you use Laravel (or any PHP project) in front to create routes, views and controllers that fetch WordPress data through Corcel. It covers posts, pages, custom post types, taxonomies, attachments, revisions, options, menus and users. Meta can be read and written (<code>save<wbr>Meta()</code>, <code>create<wbr>Meta()</code>). ACF fields come through a separate <code>corcel/<wbr>acf</code> package. Shortcodes are registered in config and parsed by a shortcode library. A <code>corcel</code> user provider lets Laravel's <code>Auth</code> validate WordPress users. It is released under the MIT license.</p>
<p><strong>kitloom</strong> is a Laravel CMS whose storage is the WordPress database. It has Eloquent models over the same tables, with Laravel names (<code>$post-<wbr>&gt;title</code>, <code>$post-<wbr>&gt;field('price')</code>, <code>Settings::<wbr>get()</code>), and on top of them:</p>
<ul>
<li>request handling the way WordPress does it: permalink settings, rewrite rules, the main query, canonical redirects and the template hierarchy;</li>
<li>writers (<code>Post<wbr>Writer</code>, <code>Term<wbr>Writer</code>, <code>Comment<wbr>Writer</code>) that make slugs unique, fill dates and check what the acting user may do, with events other code listens to;</li>
<li>an admin in Filament 5 or Laravel Nova 5;</li>
<li>about 40 modules, many of which read a plugin's data in that plugin's own format;</li>
<li>themes in Blade, Vue or React, every page as JSON, and an MCP server for AI agents.</li>
</ul>
<p>WordPress itself is retired. Its PHP does not run.</p>
<h2 id="side-by-side" tabindex="-1">Side by side <a class="header-anchor" href="#side-by-side" aria-label="Permalink to &quot;Side by side&quot;">&ZeroWidthSpace;</a></h2>
<table tabindex="0">
<thead>
<tr>
<th></th>
<th>Corcel</th>
<th>kitloom</th>
</tr>
</thead>
<tbody>
<tr>
<td>What it is</td>
<td>A library of Eloquent models</td>
<td>A CMS: models, site, admin, modules, themes</td>
</tr>
<tr>
<td>Where content lives</td>
<td>The WordPress database</td>
<td>The WordPress database</td>
</tr>
<tr>
<td>Who edits content</td>
<td>WordPress's admin, which keeps running</td>
<td>Filament 5 or Laravel Nova 5; WordPress is retired</td>
</tr>
<tr>
<td>URLs</td>
<td>The routes you write in your app</td>
<td>WordPress's permalinks, rewrite rules and canonical redirects, read from the database; the same URLs answer</td>
</tr>
<tr>
<td>Users' passwords</td>
<td>A <code>corcel</code> auth provider validates WordPress users in Laravel</td>
<td>A <code>wordpress</code> auth driver and hasher (phpass and WordPress 6.8's bcrypt); users sign in as before</td>
</tr>
<tr>
<td>Plugin data</td>
<td>Meta through the models; ACF through <code>corcel/<wbr>acf</code></td>
<td>Modules for ACF and Secure Custom Fields, Contact Form 7 and Flamingo, WooCommerce, Rank Math, LearnPress, Houzez, Listeo and others, with their admins and behaviour</td>
</tr>
<tr>
<td>Writing</td>
<td>Models and meta methods</td>
<td>Writers with permissions and events; new arrays stored as JSON</td>
</tr>
<tr>
<td>Front end</td>
<td>Yours to build</td>
<td>Blade, Vue or React themes, or page JSON and the <code>wp/<wbr>v2</code> REST API</td>
</tr>
<tr>
<td>WordPress code still running</td>
<td>Yes, as the admin, if you keep it</td>
<td>None</td>
</tr>
<tr>
<td>AI agents (MCP)</td>
<td>None: it is a set of models, so an agent is something you build</td>
<td>Built in (<code>kitloom/<wbr>ai</code>): Claude, Cursor or your own agent connects to <code>/<wbr>mcp</code> and works on content, media, settings and every installed module, with the rights of the key's user; locked settings, nothing deleted for good, every change in the activity log</td>
</tr>
<tr>
<td>Price model</td>
<td>Free, MIT</td>
<td>$299 for one site, once, with 12 months of every update and new module, free updates of what you have after that, and a 14-day refund</td>
</tr>
</tbody>
</table>
<h2 id="when-corcel-is-the-better-choice" tabindex="-1">When Corcel is the better choice <a class="header-anchor" href="#when-corcel-is-the-better-choice" aria-label="Permalink to &quot;When Corcel is the better choice&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>You only need to read WordPress data inside your own app.</strong> A Laravel application that shows the latest blog posts, a dashboard over WooCommerce data, an app that signs in WordPress users. Corcel is a small dependency for that, and kitloom would be far more than you need.</li>
<li><strong>WordPress stays the CMS.</strong> If editors keep writing in <code>wp-<wbr>admin</code> and WordPress keeps drawing most of the site, Corcel lets Laravel read alongside it. kitloom is not meant to share a database with a WordPress that keeps writing to it: kitloom writes new arrays as JSON, which WordPress does not read.</li>
<li><strong>You are not on Laravel.</strong> Corcel works in any PHP project. kitloom needs PHP 8.4 and Laravel 13.</li>
<li><strong>It has to be free and open source.</strong> Corcel is MIT. kitloom is a paid, commercial product.</li>
</ul>
<h2 id="when-kitloom-is" tabindex="-1">When kitloom is <a class="header-anchor" href="#when-kitloom-is" aria-label="Permalink to &quot;When kitloom is&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom is for the case where the Laravel app is meant to <em>become</em> the site, and WordPress is meant to go:</p>
<ul>
<li><strong>An AI agent runs the site, under your control.</strong> kitloom ships an MCP server. Claude, Cursor or your own agent connects to <code>/<wbr>mcp</code> and does the work: posts and pages, media, menus, SEO and redirects, form messages, the shop's products, orders and sales, bookings, courses, translations. It acts as the user whose key it holds, through the same code as the admin. An author's key writes drafts, a read-only key only reads, and the settings that decide who gets in or what code runs on every page are locked. Nothing is deleted for good, every change is in the activity log, and revoking the key stops it at once. See <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</li>
<li><strong>Every URL has to keep working.</strong> Single posts, pages under pages, category and tag archives, date archives, author pages, pagination, search, the static front page, old slugs. With Corcel each of those is a route and a query you write. kitloom handles them the way WordPress does, from the site's own settings.</li>
<li><strong>Editors need an admin.</strong> Without WordPress, Corcel leaves you with no place to write posts. kitloom brings one: posts, pages, media, menus, widgets, users and roles, plus each module's screens.</li>
<li><strong>The plugins' data has to keep working, not just be readable.</strong> A Contact Form 7 form that still sends, Flamingo messages someone still reads, WooCommerce orders that can be refunded, Rank Math redirects that still redirect, LearnPress students who keep their progress. That is behaviour on top of the data, and in kitloom each of those is a module. Polylang and WPML sites are converted once. What is not read yet, such as Yoast SEO's meta (in progress), is listed on <a href="https://kitloom.dev/docs/modules/wordpress.html">WordPress Compatibility</a>.</li>
<li><strong>Writes have to follow the rules.</strong> Unique slugs, dates, term counts, who may publish what, events that a cache or a search index listen to. In kitloom that is the writers' job, not each controller's.</li>
</ul>
<p>Corcel and kitloom share a view of the problem: the WordPress schema is fine, it is the code around it that teams want to replace. Corcel replaces the read side. kitloom replaces the whole application.</p>
<h2 id="rehearsing-the-move" tabindex="-1">Rehearsing the move <a class="header-anchor" href="#rehearsing-the-move" aria-label="Permalink to &quot;Rehearsing the move&quot;">&ZeroWidthSpace;</a></h2>
<p>Because kitloom reads the database as it is, you can look at your site through it before deciding anything. Give it a MySQL user that may only <code>SELECT</code>, point it at the live database, and run the comparison script against the WordPress site. It reports, address by address, where status codes, redirects, titles, canonical tags, content or archive lists differ, and where a shortcode reached the page as text. See <a href="https://kitloom.dev/blog/rehearse-the-move.html">Test a WordPress to Laravel migration on the live database</a>.</p>
<h2 id="try-both" tabindex="-1">Try both <a class="header-anchor" href="#try-both" aria-label="Permalink to &quot;Try both&quot;">&ZeroWidthSpace;</a></h2>
<p>Corcel is on <a href="https://github.com/corcel/corcel" target="_blank" rel="noreferrer">GitHub</a> and installs with Composer.</p>
<p>For kitloom, open a sandbox in one click, no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament demo</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova demo</a>. Then follow <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a> on your own data, starting read-only. Prices and the refund are on <a href="https://kitloom.dev/pricing.html">Pricing</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Headless WordPress with Laravel vs keeping just the database</title>
      <link>https://kitloom.dev/blog/kitloom-vs-headless-wordpress.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/kitloom-vs-headless-wordpress.html</guid>
      <pubDate>Wed, 21 Oct 2026 12:00:00 GMT</pubDate>
      <description>Headless WordPress keeps WordPress as the back end of a Laravel front. kitloom keeps only the WordPress database and replaces WordPress itself. Which one fits, and when.</description>
      <content:encoded><![CDATA[<p>Teams that want out of a WordPress theme often reach for headless WordPress first. It is a sensible move: nothing has to be migrated, editors keep the admin they know, and the front end can be anything. kitloom also keeps the WordPress data where it is, but it makes the opposite cut. Headless WordPress keeps WordPress and replaces the front. kitloom keeps the database and replaces WordPress.</p>
<p>So the question is not which one keeps your content. Both do. The question is which part of WordPress you want to leave behind.</p>
<h2 id="what-each-one-is" tabindex="-1">What each one is <a class="header-anchor" href="#what-each-one-is" aria-label="Permalink to &quot;What each one is&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Headless WordPress</strong> means WordPress stays as the content back end, with <code>wp-<wbr>admin</code>, the block editor and its plugins, while a separate application draws the site. That application reads content over an API:</p>
<ul>
<li><strong>The WordPress REST API</strong>, part of WordPress itself. Its handbook describes it as an interface &quot;for applications to interact with your WordPress site&quot;, sending and receiving JSON, and it is also the foundation of the block editor. Public content is available without signing in; private content, custom post types and meta are available with authentication or when they are set to be shown.</li>
<li><strong>WPGraphQL</strong>, a free, open-source plugin that adds a GraphQL schema and API to WordPress. It has a first-party extension that exposes Advanced Custom Fields to the schema.</li>
</ul>
<p><strong>kitloom</strong> is a Laravel CMS whose storage is the WordPress database: <code>wp_<wbr>posts</code>, <code>wp_<wbr>postmeta</code>, <code>wp_<wbr>terms</code>, <code>wp_<wbr>options</code>, <code>wp_<wbr>users</code> and the plugins' tables. It handles a request the way WordPress does, so the same URLs answer, and it has its own admin in Filament 5 or Laravel Nova 5. WordPress's PHP no longer runs. kitloom can be headless too: every page also answers as JSON, and <code>kitloom/<wbr>api</code> serves the basics of WordPress's <code>wp/<wbr>v2</code> REST API.</p>
<h2 id="side-by-side" tabindex="-1">Side by side <a class="header-anchor" href="#side-by-side" aria-label="Permalink to &quot;Side by side&quot;">&ZeroWidthSpace;</a></h2>
<table tabindex="0">
<thead>
<tr>
<th></th>
<th>Headless WordPress</th>
<th>kitloom</th>
</tr>
</thead>
<tbody>
<tr>
<td>Where content lives</td>
<td>The WordPress database</td>
<td>The same WordPress database</td>
</tr>
<tr>
<td>Moving an existing WordPress site</td>
<td>Nothing moves; you build a new front end</td>
<td>Point a kitloom application at the database; <code>migrate</code> adds kitloom's tables beside WordPress's</td>
</tr>
<tr>
<td>URLs after the move</td>
<td>Whatever the new front end's router produces; matching WordPress's permalinks is its job</td>
<td>WordPress's permalink settings, rewrite rules and canonical redirects are read, so the same URLs answer</td>
</tr>
<tr>
<td>Users' passwords</td>
<td>Unchanged; WordPress still signs users in</td>
<td>Kept; WordPress's hashes (phpass and bcrypt) are read</td>
</tr>
<tr>
<td>Plugin data</td>
<td>Plugins keep running; the front end sees what they expose over REST or GraphQL</td>
<td>Read by kitloom modules in each plugin's format, for the plugins listed on <a href="https://kitloom.dev/docs/modules/wordpress.html">WordPress Compatibility</a></td>
</tr>
<tr>
<td>Admin</td>
<td><code>wp-<wbr>admin</code> with the block editor</td>
<td>Filament 5 or Laravel Nova 5, with a visual editor</td>
</tr>
<tr>
<td>Front end</td>
<td>Any framework, as a separate application</td>
<td>Blade, Vue or React themes in the same application, or any front end on page JSON</td>
</tr>
<tr>
<td>WordPress code still running</td>
<td>Yes: core, plugins and their updates</td>
<td>None</td>
</tr>
<tr>
<td>Applications to run</td>
<td>Two: WordPress and the front end</td>
<td>One Laravel application</td>
</tr>
<tr>
<td>AI agents (MCP)</td>
<td>WordPress's MCP Adapter plugin (pre-1.0) exposes the abilities the site's plugins register, and nothing until they opt in</td>
<td>Built in (<code>kitloom/<wbr>ai</code>): Claude, Cursor or your own agent connects to <code>/<wbr>mcp</code> and works on content, media, settings and every installed module, with the rights of the key's user; locked settings, nothing deleted for good, every change in the activity log</td>
</tr>
<tr>
<td>Price model</td>
<td>WordPress and WPGraphQL are free; you host and maintain both applications</td>
<td>$299 for one site, once, with 12 months of every update and new module, free updates of what you have after that, and a 14-day refund</td>
</tr>
</tbody>
</table>
<h2 id="when-headless-wordpress-is-the-better-choice" tabindex="-1">When headless WordPress is the better choice <a class="header-anchor" href="#when-headless-wordpress-is-the-better-choice" aria-label="Permalink to &quot;When headless WordPress is the better choice&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>Editors must keep <code>wp-<wbr>admin</code> and Gutenberg.</strong> If the people who write the site depend on the block editor and its patterns, headless WordPress keeps that exactly. kitloom has no block editor; blocks already in content are drawn as WordPress draws them, and new content is written in a visual editor.</li>
<li><strong>The site depends on plugins kitloom does not cover.</strong> In headless WordPress every plugin keeps working on the back end. In kitloom a plugin without a module leaves its data in the database and its shortcodes on the page as text.</li>
<li><strong>You want a way back at any time.</strong> Nothing about headless WordPress is one way. kitloom writes new arrays as JSON, which WordPress does not read, so going back means restoring a backup.</li>
<li><strong>The front end is built on WPGraphQL.</strong> kitloom has no GraphQL. A Next.js or Nuxt front that reads WordPress's REST API works with kitloom too (see below), but one written against WPGraphQL's schema would have to move to REST or to kitloom's page JSON first.</li>
<li><strong>There is no budget for a license.</strong> WordPress and WPGraphQL are free.</li>
</ul>
<h2 id="when-kitloom-is" tabindex="-1">When kitloom is <a class="header-anchor" href="#when-kitloom-is" aria-label="Permalink to &quot;When kitloom is&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom fits when the problem is WordPress itself, not only its themes:</p>
<ul>
<li><strong>An AI agent runs the site, under your control.</strong> kitloom ships an MCP server. Claude, Cursor or your own agent connects to <code>/<wbr>mcp</code> and does the work: posts and pages, media, menus, SEO and redirects, form messages, the shop's products, orders and sales, bookings, courses, translations. It acts as the user whose key it holds, through the same code as the admin. An author's key writes drafts, a read-only key only reads, and the settings that decide who gets in or what code runs on every page are locked. Nothing is deleted for good, every change is in the activity log, and revoking the key stops it at once. See <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</li>
<li><strong>You want WordPress off the server.</strong> No core and plugin updates to track, no <code>functions.<wbr>php</code>, no hooks. The code is Laravel: Eloquent models, events, queues, Composer packages and tests. See <a href="https://kitloom.dev/docs/wordpress-and-laravel.html">What Is WordPress Here, What Is Laravel</a>.</li>
<li><strong>One application instead of two.</strong> Headless WordPress means running, securing and deploying WordPress and a separate front end. kitloom is one Laravel app with the admin, the site and the API in it.</li>
<li><strong>URLs should keep working without writing a router.</strong> kitloom reads the permalink settings, category and tag bases, the static front page and the canonical redirect, as WordPress did. A headless front has to reproduce all of that itself.</li>
<li><strong>You still want a JavaScript front.</strong> kitloom's Vue and React themes run on Inertia in the same application. Or ask any address with <code>Accept:<wbr> application/<wbr>json</code> and get the page as data: its kind, its template and its parts. See <a href="https://kitloom.dev/docs/headless.html">Headless &amp; APIs</a>.</li>
<li><strong>Your Next.js or Nuxt front can stay.</strong> kitloom serves WordPress's REST API at the same address, <code>/<wbr>wp-<wbr>json/<wbr>wp/<wbr>v2/</code>, with the same routes, parameters and <code>X-<wbr>WP-<wbr>Total</code> headers for the core fields, so a decoupled front written against WordPress can point at kitloom instead. Fields that plugins add to the REST answers are not there, and <code>meta</code> is empty, so check what your front reads. See <a href="https://kitloom.dev/docs/headless.html#the-wordpress-rest-api">The WordPress REST API</a>.</li>
<li><strong>The plugin data is covered.</strong> ACF and Secure Custom Fields, Contact Form 7 and Flamingo, WooCommerce with HPOS orders, Rank Math, LearnPress, Houzez and Listeo, Slide Anything, Nextend Social Login. Polylang and WPML sites are converted once. Yoast SEO's meta is not read today; support is in progress.</li>
</ul>
<h2 id="the-move-itself" tabindex="-1">The move itself <a class="header-anchor" href="#the-move-itself" aria-label="Permalink to &quot;The move itself&quot;">&ZeroWidthSpace;</a></h2>
<p>A headless project has no migration step, which is its appeal. kitloom keeps that risk low a different way: it can draw the site from the <strong>live</strong> database with a MySQL user that may only <code>SELECT</code>, while WordPress goes on as it is. A script then compares the two sites address by address: status codes, redirects, titles, canonical tags, content, the lists on archives, leftover shortcodes. You switch when the report says what you want it to say. The steps are in <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a>, and the reasoning in <a href="https://kitloom.dev/blog/migrate-wordpress-to-laravel.html">Migrate WordPress to Laravel without moving the content</a>.</p>
<h2 id="try-both" tabindex="-1">Try both <a class="header-anchor" href="#try-both" aria-label="Permalink to &quot;Try both&quot;">&ZeroWidthSpace;</a></h2>
<p>For headless WordPress, start with the <a href="https://developer.wordpress.org/rest-api/" target="_blank" rel="noreferrer">REST API Handbook</a> or <a href="https://www.wpgraphql.com/" target="_blank" rel="noreferrer">WPGraphQL</a>, on a copy of your site.</p>
<p>For kitloom, open a sandbox in one click, no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament demo</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova demo</a>. Then look at your own site through kitloom with a read-only database user, as <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a> describes. Prices and the refund are on <a href="https://kitloom.dev/pricing.html">Pricing</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Rank Math in Laravel: keep SEO titles, sitemaps and redirects</title>
      <link>https://kitloom.dev/blog/rank-math-in-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/rank-math-in-laravel.html</guid>
      <pubDate>Wed, 21 Oct 2026 12:00:00 GMT</pubDate>
      <description>Rank Math's SEO titles, sitemaps and redirects in Laravel: kitloom reads them as Rank Math left them, so a move from WordPress gives rankings nothing new to adjust to.</description>
      <content:encoded><![CDATA[<p>When a site moves to a new platform, search rankings suffer from what changed on the way: titles back at their defaults, a canonical pointing somewhere new, a sitemap at another address, years of redirects left behind. On a WordPress site with Rank Math, all of that lives in the plugin's data:</p>
<ul>
<li><strong>Settings</strong> are serialized arrays with <code>on</code>/<code>off</code> switches, in four options: <code>rank-<wbr>math-<wbr>options-<wbr>titles</code> (title and description templates), <code>rank-<wbr>math-<wbr>options-<wbr>general</code> (breadcrumbs, verification codes, robots.txt, redirect settings), <code>rank-<wbr>math-<wbr>options-<wbr>sitemap</code> and <code>rank-<wbr>math-<wbr>options-<wbr>instant-<wbr>indexing</code>.</li>
<li><strong>Each record's own head</strong> is in meta: <code>rank_<wbr>math_<wbr>title</code>, <code>rank_<wbr>math_<wbr>description</code>, <code>rank_<wbr>math_<wbr>robots</code>, <code>rank_<wbr>math_<wbr>canonical_<wbr>url</code>, <code>rank_<wbr>math_<wbr>focus_<wbr>keyword</code>, <code>rank_<wbr>math_<wbr>breadcrumb_<wbr>title</code>, the Facebook and Twitter fields, and <code>rank_<wbr>math_<wbr>primary_<wbr>category</code>.</li>
<li><strong>Redirects and the 404 log</strong> are tables of their own: <code>rank_<wbr>math_<wbr>redirections</code>, <code>rank_<wbr>math_<wbr>redirections_<wbr>cache</code>, <code>rank_<wbr>math_<wbr>404_<wbr>logs</code>. The link counter has <code>rank_<wbr>math_<wbr>internal_<wbr>links</code> and <code>rank_<wbr>math_<wbr>internal_<wbr>meta</code>.</li>
</ul>
<p>A usual Laravel rebuild adds an SEO package and imports what it can. The templates with their variables (<code>%title% %sep% %sitename%</code>) have to be written again. The sitemaps move to the package's addresses, and the redirect rules go into a new table with different matching rules. Each of those is a chance for a page to answer differently than it did.</p>
<h2 id="how-kitloom-reads-it" tabindex="-1">How kitloom reads it <a class="header-anchor" href="#how-kitloom-reads-it" aria-label="Permalink to &quot;How kitloom reads it&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom runs on the WordPress database as it is, and three modules read Rank Math's data where the plugin keeps it.</p>
<p><strong><code>kitloom/<wbr>seo</code></strong> draws the head of every page from the record's meta or its type's template:</p>
<ul>
<li>the title, description, robots and canonical, with the page number on page 2 and further;</li>
<li>Open Graph and Twitter tags, and the webmaster verification codes on the front page;</li>
<li>schema.org markup for the site's owner, the website with its search, the page, its breadcrumbs, and an article where the type asks for one;</li>
<li>breadcrumbs with Rank Math's labels and the primary category.</li>
</ul>
<p>It serves the sitemaps at Rank Math's addresses (<code>/<wbr>sitemap_<wbr>index.<wbr>xml</code>, <code>/<wbr>{type}-<wbr>sitemap.<wbr>xml</code>, <code>/<wbr>main-<wbr>sitemap.<wbr>xsl</code>), <code>robots.<wbr>txt</code> with its saved text, Google's HTML verification file, and <code>[rank_<wbr>math_<wbr>html_<wbr>sitemap]</code>. Instant indexing sends new and changed addresses to IndexNow and to Google's Indexing API.</p>
<p><strong><code>kitloom/<wbr>redirects</code></strong> runs on the redirection tables. Every rule keeps working: exact, contains, starts with, ends with and regex; 301, 302 and 307, or a 410 or 451 status. When several rules match, the newest wins, and hits are counted. The settings are followed too: where a missing page goes, and Auto Post Redirect, which leaves a rule behind when a slug changes. The 404 monitor goes on writing to the same log, in simple or advanced mode.</p>
<p><strong><code>kitloom/<wbr>internal-<wbr>links</code></strong> counts links the way Rank Math's Link Counter does, in the same tables, and lists orphans: published posts nothing links to.</p>
<p>In code, the options are read and written key by key, so the keys a screen does not own stay as they are:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> Kitloom\Seo\RankMath\Options</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">app</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">TITLES</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'title_separator'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'-'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">app</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::class</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">isOn</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">Options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">SITEMAP</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'authors_sitemap'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span></code></pre>
</div><h2 id="what-the-admin-shows" tabindex="-1">What the admin shows <a class="header-anchor" href="#what-the-admin-shows" aria-label="Permalink to &quot;What the admin shows&quot;">&ZeroWidthSpace;</a></h2>
<p>Both admins, Filament and Nova, have an <strong>SEO</strong> section laid out like Rank Math's menu:</p>
<ul>
<li><strong>General Settings</strong>: breadcrumbs, webmaster tools, robots.txt.</li>
<li><strong>Titles &amp; Meta</strong>: global meta, local SEO, the home page, authors, other pages, and a tab per post type and taxonomy.</li>
<li><strong>Sitemap Settings</strong>: what gets a sitemap and how many links a file holds.</li>
<li><strong>Instant Indexing</strong>: submit addresses by hand, choose what is sent on its own, and see what the services answered.</li>
</ul>
<p>Post and taxonomy forms get an <strong>SEO</strong> block (a tab in Nova) with the title, description, focus keyword, robots, canonical, breadcrumb title, primary category and social previews. An empty field falls back to the template.</p>
<p>The <strong>Redirects</strong> section has Redirections (rules with several sources each, bulk activate, deactivate and trash), the 404 Monitor (make a rule from logged rows, clear the log) and Settings. <strong>Internal Links</strong> has Posts, Links and Orphans, plus a links column in the post lists.</p>
<p>With <code>kitloom/<wbr>ai</code> installed, an agent reads and changes a record's head meta (<code>seo_<wbr>get</code>, <code>seo_<wbr>update</code>), manages redirect rules, and turns 404 log rows into a rule (<code>redirect_<wbr>from_<wbr>404</code>). It moves rules to the trash and never deletes them.</p>
<h2 id="what-changes-and-what-is-not-covered" tabindex="-1">What changes and what is not covered <a class="header-anchor" href="#what-changes-and-what-is-not-covered" aria-label="Permalink to &quot;What changes and what is not covered&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>The move is one way.</strong> Rank Math's serialized options and redirect sources are read. What kitloom saves is JSON, which Rank Math on WordPress would not read back.</li>
<li><strong>Rank Math's per-post schema</strong> from its Schema Generator is not read. kitloom builds its schema.org graph from the settings.</li>
<li><strong>Content analysis and the SEO score</strong> are not there. The focus keyword is kept and editable.</li>
<li><strong>Yoast SEO and the Redirection plugin are imported, not read in place.</strong> <strong>SEO → General → Import from Yoast SEO</strong> and <strong>Redirects → Settings → Import from Redirection</strong> take their data once into Rank Math's keys and tables; from then on the site works with those, and the report names what had no place to go.</li>
<li><strong>Feeds and WordPress's own sitemap.</strong> kitloom sites have no RSS feeds, so <code>/<wbr>feed/</code> answers 404. <code>/<wbr>wp-<wbr>sitemap.<wbr>xml</code> is not served; <code>/<wbr>sitemap_<wbr>index.<wbr>xml</code> is.</li>
<li><strong>A static file wins.</strong> A <code>robots.<wbr>txt</code> or verification file left in <code>public/</code> is served before kitloom is asked. Remove it.</li>
<li><strong>Plugin code does not run.</strong> All of this is kitloom's own code, written from Rank Math's data model.</li>
</ul>
<p>The keys, addresses and settings are in the guides for <a href="https://kitloom.dev/docs/modules/guides/seo.html">SEO</a>, <a href="https://kitloom.dev/docs/modules/guides/redirects.html">Redirections</a> and <a href="https://kitloom.dev/docs/modules/guides/internal-links.html">Internal Links</a>.</p>
<h2 id="keep-seo-in-shape-with-an-ai-agent" tabindex="-1">Keep SEO in shape with an AI agent <a class="header-anchor" href="#keep-seo-in-shape-with-an-ai-agent" aria-label="Permalink to &quot;Keep SEO in shape with an AI agent&quot;">&ZeroWidthSpace;</a></h2>
<p>SEO after a move is a long tail of small jobs, and that is what an agent does well. With <code>kitloom/<wbr>ai</code> installed, an agent connected to the site reads and writes each record's head meta (<code>seo_<wbr>get</code>, <code>seo_<wbr>update</code>), manages redirect rules (<code>redirects_<wbr>list</code>, <code>redirects_<wbr>create</code>, <code>redirects_<wbr>update</code>), reads the 404 log (<code>not_<wbr>found_<wbr>list</code>) and turns a missed address into a rule (<code>redirect_<wbr>from_<wbr>404</code>). You ask:</p>
<ul>
<li><em>&quot;Which addresses gave 404 since the switch? Redirect the ones that have a new page and list the rest.&quot;</em></li>
<li><em>&quot;Write meta descriptions for the posts that have none, under 155 characters.&quot;</em></li>
<li><em>&quot;Find the pages whose SEO title is longer than 60 characters and shorten them.&quot;</em></li>
</ul>
<p>It acts as the user whose key it holds, rules go to the trash rather than away, and every change is in the activity log. How to connect one: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="check-it-on-your-own-site" tabindex="-1">Check it on your own site <a class="header-anchor" href="#check-it-on-your-own-site" aria-label="Permalink to &quot;Check it on your own site&quot;">&ZeroWidthSpace;</a></h2>
<p>Create a MySQL user that can only read, point kitloom at the live database, and run <code>compare-<wbr>sites.<wbr>php</code> against both sites. It takes the addresses from both sites' sitemaps, plus any list you give it. Give it your most visited pages from Search Console. For each address it compares the status code, the redirect target, robots (an error when one side says <code>noindex</code>), the title, description and canonical, the content, and the posts an archive lists.</p>
<p>The read-only look leaves the redirects module out: redirects, like the admin, need a copy of the database that <code>php artisan migrate</code> has run on. Test your redirects there. The steps are in <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a>, and what to watch after the switch is in <a href="https://kitloom.dev/blog/keep-seo-when-leaving-wordpress.html">Leave WordPress without losing SEO rankings</a>.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. When it fits, see <a href="https://kitloom.dev/pricing.html">Pricing</a>.</p>
<p>SEO data is one part of a site's plugin data. The same approach covers <a href="https://kitloom.dev/blog/woocommerce-to-laravel.html">WooCommerce</a>, <a href="https://kitloom.dev/blog/acf-in-laravel.html">ACF fields</a> and <a href="https://kitloom.dev/blog/contact-form-7-in-laravel.html">Contact Form 7 and Flamingo</a>. An overview is in <a href="https://kitloom.dev/blog/plugin-data-after-the-move.html">your plugin data after moving to Laravel</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Laravel CMS with an MCP server: run your site from Claude</title>
      <link>https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html</guid>
      <pubDate>Wed, 21 Oct 2026 12:00:00 GMT</pubDate>
      <description>A Laravel CMS with an MCP server on every site: Claude, ChatGPT, Cursor or your own agent signs in, writes posts, fixes SEO and reads orders with exactly the rights of its user.</description>
      <content:encoded><![CDATA[<p>Most of what people do in a CMS admin is small and repetitive. They write a meta description for each product that has none, redirect the pages that started returning 404, replace an old phone number on twelve pages, or check how many orders came in today. An AI agent is good at exactly that kind of work, as long as it can reach the site and you can trust what it reaches.</p>
<p>kitloom ships an <a href="https://modelcontextprotocol.io" target="_blank" rel="noreferrer">MCP</a> server for that. Turn it on and the site has an address, <code>https://<wbr>your-<wbr>site/<wbr>mcp</code>. claude.ai, ChatGPT, Claude Code, Cursor, VS Code or any other MCP client connects to it with nothing but that address: you sign in to your site, approve the agent, and it runs the site from its chat.</p>
<h2 id="connecting-takes-a-minute" tabindex="-1">Connecting takes a minute <a class="header-anchor" href="#connecting-takes-a-minute" aria-label="Permalink to &quot;Connecting takes a minute&quot;">&ZeroWidthSpace;</a></h2>
<ol>
<li>
<p>In the admin, <strong>AI agents → Settings</strong>: turn agents on.</p>
</li>
<li>
<p>Give the agent the address. For Claude Code that is one line:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">claude</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> mcp</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> add</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --transport</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> http</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> kitloom</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> https://your-site/mcp</span></span></code></pre>
</div></li>
<li>
<p>The first time the agent uses the site, a browser opens. Sign in to the site and press <strong>Approve</strong>.</p>
</li>
</ol>
<p>In claude.ai it's a custom connector with the same address, then <strong>Connect</strong>. That works on the web, on a phone and in Claude Desktop. ChatGPT takes the address as a connector in developer mode. <strong>AI agents → Connect an agent</strong> shows the steps for each client, with <em>Add to Cursor</em> and <em>Add to VS Code</em> buttons. <a href="https://kitloom.dev/blog/connect-claude-or-chatgpt-to-your-laravel-site.html">Connecting without a key</a> goes through them, and the <a href="https://kitloom.dev/docs/ai.html">AI Agents guide</a> has every client.</p>
<p>A client that doesn't sign in, a read-only agent or an automation takes a key instead: <strong>Create a key</strong> on the same page makes one and shows the settings to paste.</p>
<h2 id="what-the-agent-can-do" tabindex="-1">What the agent can do <a class="header-anchor" href="#what-the-agent-can-do" aria-label="Permalink to &quot;What the agent can do&quot;">&ZeroWidthSpace;</a></h2>
<p>Its first call is <code>describe_<wbr>site</code>. It returns the post types and taxonomies, what each one supports, which fields show where, the menu places, and what its user may do with each type. Then it has tools for the whole site:</p>
<ul>
<li><strong>Content.</strong> It can list, read, create and update posts, pages and any post type. It can move records to the trash and restore them, manage terms, upload media from a link or a file, and change settings.</li>
<li><strong>Seeing the site.</strong> <code>resolve_<wbr>url</code> tells what lives at an address and which template draws it. <code>render_<wbr>page</code> shows a page as a visitor sees it, as text, HTML or the page's parts as JSON, including a draft's preview.</li>
<li><strong>The modules' tools.</strong> Every installed module adds its own: SEO meta, redirects and the 404 log, menus, widgets, custom fields, forms and their messages, comments, the shop's products, orders, sales and coupons, bookings, courses, listings, translations, broken links, backups, the activity log, Site Health, webhooks and maintenance mode.</li>
</ul>
<p>So you can ask for whole jobs, not single edits:</p>
<ul>
<li><em>&quot;Fill in the SEO descriptions of the products that have none.&quot;</em></li>
<li><em>&quot;Which addresses gave 404 this week? Redirect the ones that have a new page.&quot;</em></li>
<li><em>&quot;Find the pages that still mention the old phone number and fix them.&quot;</em></li>
<li><em>&quot;Write a draft post about our spring collection, put it in News, and take the cover from this link.&quot;</em></li>
<li><em>&quot;How did the shop do this month, and which products sold best?&quot;</em></li>
</ul>
<p>The <a href="https://kitloom.dev/docs/ai.html#video-lessons">video lessons</a> show a real agent doing these on a demo site. The chat is on the left, and every tool call changes the site on the right.</p>
<h2 id="exactly-the-access-you-give-it" tabindex="-1">Exactly the access you give it <a class="header-anchor" href="#exactly-the-access-you-give-it" aria-label="Permalink to &quot;Exactly the access you give it&quot;">&ZeroWidthSpace;</a></h2>
<p>Handing an agent the keys to a production site is the part that worries people, and it's the part kitloom was designed around:</p>
<ul>
<li><strong>The agent works as a user.</strong> That is the user who approved it, or whose key it holds. The agent sees and writes what that user may, through the same code the admin uses. An author's agent writes drafts, an editor's publishes, and a read-only key gets only the reading tools.</li>
<li><strong>Nothing is deleted for good.</strong> Records go to the trash and can be restored. Permanent deletion stays with a person in the admin.</li>
<li><strong>Some settings are out of reach.</strong> Secrets and the site address are never shown. Settings that decide who gets in (registration, roles, two-factor), the doors into the site (agents, the REST API) and the code on every page (header scripts, tag manager, analytics) are locked. The agent sees them but can't change them, because a page it reads could try to talk it into it.</li>
<li><strong>Everything is written down.</strong> The activity log records each change under the agent's user. <strong>Revoke</strong> under <strong>Connected agents</strong>, or revoking its key, stops the agent at once.</li>
<li><strong>Requests are limited.</strong> Each user gets 120 requests a minute by default.</li>
</ul>
<h2 id="when-the-site-should-ask-a-model-itself" tabindex="-1">When the site should ask a model itself <a class="header-anchor" href="#when-the-site-should-ask-a-model-itself" aria-label="Permalink to &quot;When the site should ask a model itself&quot;">&ZeroWidthSpace;</a></h2>
<p>An agent is your subscription working on the site from outside. Sometimes you want the opposite: a <strong>Translate with AI</strong> button for an editor who has no AI account. <a href="https://kitloom.dev/docs/ai-writer.html">AI Writer</a> does that. You save a provider key on the site once with a monthly budget, the modules that write text get &quot;with AI&quot; buttons, and every question is logged with its cost. <a href="https://kitloom.dev/docs/ai-overview.html">Two Ways to Use AI</a> compares the two.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Every demo sandbox is a site of your own, with no sign-up. Give your Claude or Cursor its address and approve it, or use the key ready on the dashboard. It takes a couple of minutes: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament demo</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova demo</a>.</p>
<p>And if your site is on WordPress today, it can <a href="https://kitloom.dev/blog/migrate-wordpress-to-laravel.html">move to kitloom with its database as it is</a>, and then an agent can run it.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Migrate WooCommerce to Laravel: products, orders and customers</title>
      <link>https://kitloom.dev/blog/woocommerce-to-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/woocommerce-to-laravel.html</guid>
      <pubDate>Wed, 21 Oct 2026 12:00:00 GMT</pubDate>
      <description>Migrate a WooCommerce shop to Laravel without exporting it: kitloom/shop reads WooCommerce's tables, HPOS orders and customer accounts as WooCommerce left them.</description>
      <content:encoded><![CDATA[<p>A WooCommerce shop is spread across the whole WordPress database. Products are <code>product</code> posts with their price, SKU and stock in meta (<code>_<wbr>regular_<wbr>price</code>, <code>_<wbr>sale_<wbr>price</code>, <code>_<wbr>price</code>, <code>_<wbr>sku</code>, <code>_<wbr>stock</code>, <code>_<wbr>stock_<wbr>status</code> and many more). Variations are <code>product_<wbr>variation</code> posts under them. Global attributes sit in <code>woocommerce_<wbr>attribute_<wbr>taxonomies</code>, with their values as terms of <code>pa_<wbr>*</code> taxonomies. On a current store, orders live in the HPOS tables: <code>wc_<wbr>orders</code>, <code>wc_<wbr>order_<wbr>addresses</code>, <code>wc_<wbr>order_<wbr>operational_<wbr>data</code> and <code>wc_<wbr>orders_<wbr>meta</code>, with the lines in <code>woocommerce_<wbr>order_<wbr>items</code> and <code>woocommerce_<wbr>order_<wbr>itemmeta</code>. Coupons are <code>shop_<wbr>coupon</code> posts. Shipping zones and tax rates have tables of their own, and the settings are <code>woocommerce_<wbr>*</code> options. Customers are WordPress users, with their addresses in <code>billing_<wbr>*</code> and <code>shipping_<wbr>*</code> user meta and their passwords as WordPress hashed them.</p>
<p>A usual move to Laravel picks a shop package with its own schema and writes an importer. Each step can lose something: an attribute that does not map, the tax per rate on an order line, a coupon's usage count, a refund, a saved address. Customers reset their passwords, and the importer runs again at the switch for the orders placed meanwhile.</p>
<h2 id="how-kitloom-reads-it" tabindex="-1">How kitloom reads it <a class="header-anchor" href="#how-kitloom-reads-it" aria-label="Permalink to &quot;How kitloom reads it&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom runs on the WordPress database as it is. <code>kitloom/<wbr>shop</code> takes WooCommerce's tables, meta keys and options as its own data model, so nothing is imported and there is nothing to lose in an importer. A live WooCommerce shop opens in kitloom as it is:</p>
<ul>
<li><strong>Products</strong>: simple and variable, with categories, tags, global and custom attributes, prices, SKUs, stock, upsells and cross-sells, images and reviews (comments of type <code>review</code> with their <code>rating</code>).</li>
<li><strong>Orders</strong>: from the HPOS tables, with their lines, fees, shipping, taxes per rate, coupons, notes and refunds.</li>
<li><strong>Customers</strong>: read from the orders, one per billing email, guests included. A customer with an account signs in with their WordPress password and finds their orders and saved addresses in My account.</li>
<li><strong>Coupons, shipping zones and their methods (flat rate, free shipping, local pickup), tax classes and rates</strong>, from WooCommerce's own tables.</li>
<li><strong>Settings</strong>: the store's address, where it sells and ships, the checkout options, currency, taxes and the emails, from the <code>woocommerce_<wbr>*</code> options.</li>
<li><strong>Offline payments</strong>: bank transfer and cash on delivery keep their titles and instructions, read from <code>woocommerce_<wbr>bacs_<wbr>settings</code> and <code>woocommerce_<wbr>cod_<wbr>settings</code>.</li>
</ul>
<p>The addresses stay too: <code>/<wbr>product/<wbr>…</code>, <code>/<wbr>product-<wbr>category/<wbr>…</code> and <code>/<wbr>product-<wbr>tag/<wbr>…</code>, or the bases in <code>woocommerce_<wbr>permalinks</code>. The Cart, Checkout and My account pages keep working, whether they hold WooCommerce's shortcodes or its Cart and Checkout blocks. The cart and checkout answer where WooCommerce's Store API lives, under <code>/<wbr>wp-<wbr>json/<wbr>wc/<wbr>store/<wbr>v1/</code>.</p>
<p>In code, a product and an order are Eloquent models with plain method names:</p>
<div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($product</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">isVariable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">()) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    $product</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">priceRange</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();              </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// ['min' => 18.0, 'max' => 24.0]</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    foreach</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ($product</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">variations </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">as</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> $variation) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $variation</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">sku</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        $variation</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">stockQuantity</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">$order</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">totalRefunded</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span></code></pre>
</div><p>We compare the shop with a real WooCommerce store on the same data: a suite of scenarios (coupons, taxes, shipping, stock) runs the same steps on a WooCommerce store and on kitloom over the same data and compares the totals.</p>
<h2 id="what-the-admin-shows" tabindex="-1">What the admin shows <a class="header-anchor" href="#what-the-admin-shows" aria-label="Permalink to &quot;What the admin shows&quot;">&ZeroWidthSpace;</a></h2>
<p>Both admins, Filament and Nova, have one <strong>Shop</strong> section: Orders, Coupons, Customers, the products with their categories, tags and attributes, Shipping, Shipping classes, Tax rates and Settings. The product form has WooCommerce's Product data tabs: General, Inventory, Shipping, Linked products, Advanced, and Variations for a variable product.</p>
<p>An order's page changes its status, adds notes (for the staff or for the customer), edits the addresses and, while the order is pending payment, on hold or failed, its items. <strong>Refund</strong> sends the money back through the gateway or records a refund made some other way. <strong>Add order</strong> takes an order by hand, and <strong>Send email</strong> sends one of the order's emails again.</p>
<p>The screens ask WooCommerce's own capabilities: <code>edit_<wbr>shop_<wbr>orders</code>, <code>manage_<wbr>woocommerce</code>, <code>edit_<wbr>products</code>, <code>edit_<wbr>shop_<wbr>coupons</code>. WooCommerce's Shop manager role is not created for you; make one on the roles screen if you need it.</p>
<p>With <code>kitloom/<wbr>ai</code> installed, an AI agent can read and save products, list orders, move an order to another status, leave internal notes and read sales reports, each with the rights of the user it acts as.</p>
<h2 id="what-changes-and-what-is-not-covered" tabindex="-1">What changes and what is not covered <a class="header-anchor" href="#what-changes-and-what-is-not-covered" aria-label="Permalink to &quot;What changes and what is not covered&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>The move is one way.</strong> kitloom writes arrays as JSON (<code>_<wbr>product_<wbr>attributes</code>, an order line's <code>_<wbr>line_<wbr>tax_<wbr>data</code>, list options), and WooCommerce cannot read those back. kitloom reads WooCommerce's serialized values.</li>
<li><strong>Orders are read from the HPOS tables only.</strong> A shop that still keeps its orders as <code>shop_<wbr>order</code> posts shows none of them until WooCommerce has moved them to HPOS. Do that in WooCommerce before the move.</li>
<li><strong>WooCommerce's lookup and analytics tables</strong> (<code>wc_<wbr>product_<wbr>meta_<wbr>lookup</code>, <code>wc_<wbr>order_<wbr>stats</code> and the rest) are not kept up to date, and the admin has no Analytics screen. An agent's sales reports read from the orders.</li>
<li><strong>Refunds are given in the admin.</strong> An agent may change an order's status, but not to refunded.</li>
<li><strong>Online payment gateways</strong> are set up again in <code>kitloom/<wbr>payments</code> (Stripe, Paddle, LiqPay, Monobank, WayForPay, Hutko).</li>
<li><strong>Downloadable products</strong> keep their files in meta, and paid orders get their download permissions. The shop does not serve the downloads yet, and the product form does not edit the files.</li>
<li><strong>Grouped and external products</strong> keep their type but cannot go into the cart, as in WooCommerce. An external product's button leads to the site that sells it. A grouped product's page does not list its products yet.</li>
<li><strong>Shipping methods from other plugins</strong> (table rates and the like) are listed but not offered. WooCommerce's Geolocate option is not supported.</li>
<li><strong>Extensions are plugins of their own.</strong> Their data stays in the database, but without a kitloom module nothing uses it.</li>
<li><strong>Plugin code does not run.</strong> The shop is kitloom's own code, written from WooCommerce's data model. The storefront is drawn by a kitloom theme, and there is no Gutenberg.</li>
</ul>
<p>The full list, table by table, is in the <a href="https://kitloom.dev/docs/modules/guides/shop.html">Shop guide</a>.</p>
<h2 id="run-the-shop-with-an-ai-agent" tabindex="-1">Run the shop with an AI agent <a class="header-anchor" href="#run-the-shop-with-an-ai-agent" aria-label="Permalink to &quot;Run the shop with an AI agent&quot;">&ZeroWidthSpace;</a></h2>
<p>This is where kitloom differs most from a shop you moved by hand. With <code>kitloom/<wbr>ai</code> installed, Claude, Cursor or your own agent connects to the site and works the shop through its own tools: products and their attributes (<code>products_<wbr>list</code>, <code>product_<wbr>save</code>, <code>attribute_<wbr>save</code>), orders (<code>orders_<wbr>list</code>, <code>order_<wbr>get</code>, <code>order_<wbr>set_<wbr>status</code>, <code>order_<wbr>add_<wbr>note</code>), customers, coupons (<code>coupon_<wbr>save</code>), and the numbers (<code>sales_<wbr>report</code>, <code>top_<wbr>products</code>). You ask in plain words:</p>
<ul>
<li><em>&quot;Which orders have been on hold for more than three days? Add a note to each and list them for me.&quot;</em></li>
<li><em>&quot;How did the shop do last month, and which five products sold best?&quot;</em></li>
<li><em>&quot;Write descriptions for the products that have none, as drafts.&quot;</em></li>
<li><em>&quot;Make a 10% coupon for the spring collection that ends on Sunday.&quot;</em></li>
</ul>
<p>You stay in control. The agent acts as the user whose key it holds, so a shop manager's key does what a shop manager may do and a read-only key only reads. A new product is a draft until a person publishes it. A completed or refunded order is not reopened, and refunds stay in the admin. Every change is in the activity log, and revoking the key stops the agent at once. How to connect one: <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="check-it-on-your-own-site" tabindex="-1">Check it on your own site <a class="header-anchor" href="#check-it-on-your-own-site" aria-label="Permalink to &quot;Check it on your own site&quot;">&ZeroWidthSpace;</a></h2>
<p>You can see your shop in kitloom before anything changes. Create a MySQL user that can only read, point kitloom at the live database, and run <code>compare-<wbr>sites.<wbr>php</code> against both sites. It compares status codes, titles, canonicals, content and the lists on archive pages, address by address. Products, categories and the Shop page are drawn from the same data at the same moment.</p>
<p>The cart, the checkout and signing in write to the database, so they need a copy of it. Load the copy, run <code>php artisan migrate</code>, sign in with your WordPress password and open a few orders. At the switch, the shop takes no orders until the final copy is in place. The steps are in <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a>.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox in one click, with no sign-up: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>. When it fits, see <a href="https://kitloom.dev/pricing.html">Pricing</a>.</p>
<p>The same approach covers the rest of a WooCommerce site's plugins: <a href="https://kitloom.dev/blog/acf-in-laravel.html">ACF fields</a>, <a href="https://kitloom.dev/blog/contact-form-7-in-laravel.html">Contact Form 7 and Flamingo</a> and <a href="https://kitloom.dev/blog/rank-math-in-laravel.html">Rank Math</a>. An overview is in <a href="https://kitloom.dev/blog/plugin-data-after-the-move.html">your plugin data after moving to Laravel</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Introducing kitloom</title>
      <link>https://kitloom.dev/blog/introducing-kitloom.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/introducing-kitloom.html</guid>
      <pubDate>Tue, 20 Oct 2026 12:00:00 GMT</pubDate>
      <description>A Laravel CMS that runs on a WordPress database — so a WordPress site can move to Laravel with its content, its URLs and its editors' habits.</description>
      <content:encoded><![CDATA[<p>kitloom is a CMS for Laravel that keeps its content in the WordPress database. Not a copy of it, not an import into new tables: <code>wp_<wbr>posts</code>, <code>wp_<wbr>postmeta</code>, <code>wp_<wbr>options</code>, the terms, the users, and the tables of the plugins a site already has. A WordPress site moves to kitloom with its database as it is, and keeps its URLs.</p>
<h2 id="why-the-wordpress-database" tabindex="-1">Why the WordPress database <a class="header-anchor" href="#why-the-wordpress-database" aria-label="Permalink to &quot;Why the WordPress database&quot;">&ZeroWidthSpace;</a></h2>
<p>Many Laravel teams inherit WordPress sites, and many WordPress developers would rather write Laravel. Between the two sits years of content in one well-known shape. kitloom reads and writes that shape — ACF field groups, Contact Form 7 forms and Flamingo messages, WooCommerce products and orders, Rank Math meta and redirects — in the formats those plugins use. There is no WordPress code inside: no hooks, no <code>wp-<wbr>admin</code>, just Laravel that understands the data model.</p>
<p>The public site is handled the way WordPress handles it: rewrite rules from the permalink settings, the main query, canonical redirects, the template hierarchy. A theme is Blade, Vue, React — or none, and every page answers JSON.</p>
<h2 id="filament-or-nova" tabindex="-1">Filament or Nova <a class="header-anchor" href="#filament-or-nova" aria-label="Permalink to &quot;Filament or Nova&quot;">&ZeroWidthSpace;</a></h2>
<p>The admin is yours to pick. Kitloom for Filament and Kitloom for Nova carry the same core, modules and themes; only the admin differs. Every module — custom fields, forms, the shop, SEO, redirects, languages, bookings and more — is a Composer package with an admin for each.</p>
<h2 id="an-agent-with-exactly-the-access-you-give" tabindex="-1">An agent with exactly the access you give <a class="header-anchor" href="#an-agent-with-exactly-the-access-you-give" aria-label="Permalink to &quot;An agent with exactly the access you give&quot;">&ZeroWidthSpace;</a></h2>
<p><code>kitloom/<wbr>ai</code> puts an MCP server on the site. Claude, Cursor or your own agent works with the rights of the user it acts as — an author's agent writes drafts, an editor's publishes — and every change it makes is the one that user could make in the admin. <code>kitloom/<wbr>ai-<wbr>writer</code> goes the other way: the site asks a model itself, with your key and a monthly budget, for the &quot;with AI&quot; buttons in the admin.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Each demo gives you a site of your own for a few days — the admin, the content, an agent connected to it:</p>
<ul>
<li><a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament demo</a></li>
<li><a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova demo</a></li>
</ul>
<p>Then <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a> shows how a real site comes over, and <a href="https://kitloom.dev/pricing.html">Pricing</a> what it costs.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Leave WordPress without losing SEO rankings</title>
      <link>https://kitloom.dev/blog/keep-seo-when-leaving-wordpress.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/keep-seo-when-leaving-wordpress.html</guid>
      <pubDate>Tue, 20 Oct 2026 12:00:00 GMT</pubDate>
      <description>WordPress migration SEO: rankings drop when URLs, titles, canonicals or redirects change. kitloom keeps the same URLs and Rank Math's data, and checks every page first.</description>
      <content:encoded><![CDATA[<p>The traffic dip after a site moves to a new platform is so common that SEO people plan for it. It almost never comes from the new technology. It comes from things that changed on the way: URLs that moved without a redirect, titles and descriptions that went back to defaults, canonical tags pointing somewhere new, pages that were indexable and now say <code>noindex</code>, a sitemap at a different address.</p>
<p>Search engines see a site as its addresses and what each one answers. Keep those the same and a move is a non-event for them. kitloom is built so that they stay the same.</p>
<h2 id="the-same-urls" tabindex="-1">The same URLs <a class="header-anchor" href="#the-same-urls" aria-label="Permalink to &quot;The same URLs&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom does not invent its own routing for content. It reads WordPress's permalink settings (<code>permalink_<wbr>structure</code>, the category and tag bases, the static front page and posts page) and handles a request the way WordPress does: rewrite rules, the main query, then the template hierarchy. A post at <code>/<wbr>2019/<wbr>04/<wbr>a-<wbr>post/</code>, a page at <code>/<wbr>services/<wbr>web-<wbr>design/</code>, a category at <code>/<wbr>category/<wbr>news/<wbr>page/<wbr>2/</code> all answer at the same address.</p>
<p>The canonical redirect behaves like WordPress's too: <code>?p=123</code> and <code>?page_<wbr>id=45</code> lead to the pretty address, and old links to <code>/<wbr>wp-<wbr>content/<wbr>uploads/<wbr>…</code> get a 301 to where the file lives now.</p>
<h2 id="the-same-head" tabindex="-1">The same head <a class="header-anchor" href="#the-same-head" aria-label="Permalink to &quot;The same head&quot;">&ZeroWidthSpace;</a></h2>
<p><code>kitloom/<wbr>seo</code> works on Rank Math's own data, so nothing has to be re-entered:</p>
<ul>
<li><strong>Titles and descriptions</strong>: each record's own (<code>rank_<wbr>math_<wbr>title</code>, <code>rank_<wbr>math_<wbr>description</code>), and the templates for every post type, taxonomy and archive with their variables (<code>%title% %sep% %sitename%</code>).</li>
<li><strong>Robots and canonical</strong> per record, the primary category, breadcrumb titles, Open Graph and Twitter tags.</li>
<li><strong>schema.org markup</strong>: the organisation, the website with its search, breadcrumbs, articles.</li>
<li><strong>Webmaster verification codes</strong> for Google, Bing and the others, and Google's HTML verification file, so Search Console keeps recognising the site.</li>
</ul>
<h2 id="the-same-redirects-and-404-log" tabindex="-1">The same redirects and 404 log <a class="header-anchor" href="#the-same-redirects-and-404-log" aria-label="Permalink to &quot;The same redirects and 404 log&quot;">&ZeroWidthSpace;</a></h2>
<p><code>kitloom/<wbr>redirects</code> runs on Rank Math's redirection tables. Every rule the site collected over the years (exact, contains, starts with, regex; 301, 302, 307, 410) keeps working, and the 404 monitor goes on writing to the same log. After the switch it is where you look first for addresses that people or crawlers still ask for.</p>
<h2 id="sitemaps-and-robots-txt" tabindex="-1">Sitemaps and robots.txt <a class="header-anchor" href="#sitemaps-and-robots-txt" aria-label="Permalink to &quot;Sitemaps and robots.txt&quot;">&ZeroWidthSpace;</a></h2>
<p>Sitemaps are served at Rank Math's addresses (<code>/<wbr>sitemap_<wbr>index.<wbr>xml</code> and the files under it) with the same settings: which types and taxonomies are listed, how many links per file. <code>robots.<wbr>txt</code> keeps its text. Instant indexing sends new and changed addresses to IndexNow and Google's Indexing API, as Rank Math did.</p>
<h2 id="checking-it-before-the-switch" tabindex="-1">Checking it before the switch <a class="header-anchor" href="#checking-it-before-the-switch" aria-label="Permalink to &quot;Checking it before the switch&quot;">&ZeroWidthSpace;</a></h2>
<p>The point of keeping everything is that you can verify it. kitloom can draw the site from the live database with a read-only user, and <a href="https://kitloom.dev/blog/rehearse-the-move.html"><code>compare-<wbr>sites.<wbr>php</code></a> compares WordPress and kitloom address by address, taking the addresses from both sites' sitemaps and any list you give it. Give it your most visited pages from Search Console. For each address it checks:</p>
<ul>
<li>the <strong>status code</strong> and the <strong>redirect target</strong>;</li>
<li><strong>robots</strong>, with an error when one side has <code>noindex</code>;</li>
<li><strong>title</strong>, <strong>description</strong> and <strong>canonical</strong>;</li>
<li>the <strong>content</strong> and, on archives, the <strong>posts listed and their order</strong>.</li>
</ul>
<p>An error on any of those is something to fix before the switch, not to discover in Search Console a month later.</p>
<h2 id="known-differences" tabindex="-1">Known differences <a class="header-anchor" href="#known-differences" aria-label="Permalink to &quot;Known differences&quot;">&ZeroWidthSpace;</a></h2>
<p>Some things are different on purpose, and it is better to know them up front:</p>
<ul>
<li><strong>RSS feeds</strong>: kitloom sites have none, so <code>/<wbr>feed/</code> answers 404. Redirect it if it had subscribers.</li>
<li><strong><code>/<wbr>wp-<wbr>sitemap.<wbr>xml</code></strong>, WordPress's own sitemap, is not served; <code>/<wbr>sitemap_<wbr>index.<wbr>xml</code> is.</li>
<li><strong>Query addresses</strong> other than <code>?s=</code>, <code>?p=</code>, <code>?page_<wbr>id=</code>, <code>?paged=</code> and <code>?cpage=</code> (such as <code>?cat=3</code>) are not read.</li>
<li><strong>Yoast SEO is imported once.</strong> <strong>SEO → General → Import from Yoast SEO</strong> (or <code>php artisan seo:<wbr>import --<wbr>from=yoast --<wbr>dry-<wbr>run</code> to see it first) takes the titles, descriptions, robots, canonicals and social meta of posts, terms and authors, and the templates of Titles &amp; Meta, into Rank Math's keys. Run it before you compare the sites.</li>
<li><strong>The Redirection plugin's rules are imported once</strong> too, from <strong>Redirects → Settings → Import from Redirection</strong>, with their hits. Rules that ask more than the address (signed in, referrer, browser, cookie) stay behind, and the report lists them with the reason.</li>
</ul>
<h2 id="after-the-switch" tabindex="-1">After the switch <a class="header-anchor" href="#after-the-switch" aria-label="Permalink to &quot;After the switch&quot;">&ZeroWidthSpace;</a></h2>
<p>Watch three things in the first days: the 404 log in the admin, Search Console's page indexing report, and the server's error log. Submit the sitemap again in Search Console so it is fetched from the new application, and keep the old WordPress on a backup for a while in case something needs comparing.</p>
<p>An AI agent makes this first week shorter. Connected to the site through kitloom's MCP server, it reads the 404 log (<code>not_<wbr>found_<wbr>list</code>), turns a missed address into a redirect (<code>redirect_<wbr>from_<wbr>404</code>) and fills or fixes titles and descriptions (<code>seo_<wbr>update</code>), as the user whose key it holds, with every change in the activity log: <em>&quot;Which addresses gave 404 since the switch? Redirect the ones that have a new page.&quot;</em> See <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<p>The full procedure is in <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a>, and what <code>kitloom/<wbr>seo</code> reads and writes is in its <a href="https://kitloom.dev/docs/modules/guides/seo.html">module guide</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Migrate WordPress to Laravel without moving the content</title>
      <link>https://kitloom.dev/blog/migrate-wordpress-to-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/migrate-wordpress-to-laravel.html</guid>
      <pubDate>Tue, 20 Oct 2026 12:00:00 GMT</pubDate>
      <description>How to migrate WordPress to Laravel when the hard part is the data: kitloom runs on the WordPress database as it is — same URLs, users and plugin data.</description>
      <content:encoded><![CDATA[<p>Ask a Laravel developer how long it takes to rebuild a WordPress site in Laravel and the estimate is usually about the code: the templates, the forms, the admin. Then the project starts, and most of the time goes somewhere else: the data.</p>
<h2 id="where-wordpress-migrations-really-go" tabindex="-1">Where WordPress migrations really go <a class="header-anchor" href="#where-wordpress-migrations-really-go" aria-label="Permalink to &quot;Where WordPress migrations really go&quot;">&ZeroWidthSpace;</a></h2>
<p>A WordPress site that has been running for a few years keeps more in its database than its posts:</p>
<ul>
<li><strong>Addresses.</strong> The permalink structure, category and tag bases, the static front page, pages nested under pages, attachment pages. Every one of them is a URL that search engines and other sites link to.</li>
<li><strong>Meta.</strong> <code>wp_<wbr>postmeta</code> holds a featured image here, an ACF repeater there, SEO titles, a page template, a sort order, and a few keys from a plugin that was removed in 2017.</li>
<li><strong>Options.</strong> Settings of WordPress and every plugin, much of it as PHP <code>serialize()</code> output, sometimes nested three levels deep.</li>
<li><strong>Users.</strong> Accounts with WordPress's password hashes and roles. Rebuilding means either a password reset for everyone or reimplementing the hashing.</li>
<li><strong>Plugin tables.</strong> WooCommerce orders, Rank Math redirects, form submissions, social logins. Each in a format only its plugin documents.</li>
</ul>
<p>A rewrite has to export all of that, design new tables for it, write an importer, test the importer on the real database, freeze the content for the final run, and add redirects for every URL that came out different. It is the part that is hard to estimate, and the part most likely to lose something on the way.</p>
<h2 id="same-database-new-application" tabindex="-1">Same database, new application <a class="header-anchor" href="#same-database-new-application" aria-label="Permalink to &quot;Same database, new application&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom removes that step. It is a Laravel CMS whose storage <em>is</em> the WordPress database: Eloquent models over <code>wp_<wbr>posts</code>, <code>wp_<wbr>terms</code>, <code>wp_<wbr>options</code>, <code>wp_<wbr>users</code> and the plugins' tables, reading every format WordPress and those plugins wrote, including serialized arrays. Still comparing your options? See <a href="https://kitloom.dev/blog/wordpress-alternative.html">WordPress alternative: a Laravel CMS that keeps your site</a>.</p>
<p>Moving a site is pointing a kitloom application at that database:</p>
<div class="language-ini vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ini</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">DB_CONNECTION</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=mysql</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">DB_DATABASE</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=wordpress</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">DB_PREFIX</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=wp_          </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D"># $table_prefix from wp-config.php</span></span></code></pre>
</div><p>and running <code>php artisan migrate</code>, which <strong>adds</strong> kitloom's own tables (sessions, queue, roles, the modules') beside WordPress's and leaves WordPress's tables and rows as they were. The site then has:</p>
<ul>
<li>the same posts, pages, media, menus, widgets and comments;</li>
<li>the same URLs, because kitloom handles a request the way WordPress does: the permalink settings, rewrite rules, the main query, the canonical redirect and the template hierarchy;</li>
<li>the same users, signing in with their WordPress passwords (both the old phpass hashes and WordPress 6.8's bcrypt);</li>
<li>the same plugin data, read by modules in the plugins' own formats: custom fields, forms, the shop, SEO, redirects. More on that in <a href="https://kitloom.dev/blog/plugin-data-after-the-move.html">a separate post</a>.</li>
</ul>
<p>What you write from then on is Laravel. The public API speaks Laravel names (<code>$post-<wbr>&gt;title</code>, <code>Settings::<wbr>get()</code>, <code>Menus::<wbr>get('main')</code>), writes go through writers that fill slugs and dates and check permissions, and every module is a Composer package with service providers, contracts, events and tests.</p>
<h2 id="what-is-still-work" tabindex="-1">What is still work <a class="header-anchor" href="#what-is-still-work" aria-label="Permalink to &quot;What is still work&quot;">&ZeroWidthSpace;</a></h2>
<p>Pointing at the database moves the data, not the look or the custom code:</p>
<ul>
<li><strong>The theme.</strong> A WordPress theme is PHP for WordPress and does not run. Start from a <a href="https://kitloom.dev/docs/themes/catalog.html">bundled theme</a>, <a href="https://kitloom.dev/docs/themes/generator.html">generate one</a> with every template of the hierarchy, or <a href="https://kitloom.dev/docs/themes/from-template.html">turn an HTML template into one</a>. Or go headless: every page also answers as JSON.</li>
<li><strong>Your own code.</strong> What <code>functions.<wbr>php</code> or a site plugin did (a post type, a shortcode, an email) becomes a module. <code>php artisan kitloom:<wbr>make-<wbr>module</code> writes one, with both admins and tests, that passes every check as generated.</li>
<li><strong>Plugins without a module.</strong> Their data stays in the database, their shortcodes show as text. The comparison script below finds every page where that happens.</li>
<li><strong>Files.</strong> <code>wp-<wbr>content/<wbr>uploads/</code> is copied to the media disk; old links to <code>/<wbr>wp-<wbr>content/<wbr>uploads/<wbr>…</code> get a 301 to the new address.</li>
</ul>
<p>That is real work, but it is work you can estimate, and none of it puts content at risk.</p>
<h2 id="doing-it-without-risk" tabindex="-1">Doing it without risk <a class="header-anchor" href="#doing-it-without-risk" aria-label="Permalink to &quot;Doing it without risk&quot;">&ZeroWidthSpace;</a></h2>
<p>Because nothing is converted, the move can be rehearsed for as long as you like. kitloom can even draw the site from the <strong>live</strong> database with a MySQL user that may only <code>SELECT</code>, so WordPress goes on as it is while you look at the same posts through kitloom. A script then compares the two sites address by address: status codes, redirects, titles, canonical tags, content, lists on archives, leftover shortcodes. How that works step by step is in <a href="https://kitloom.dev/blog/rehearse-the-move.html">the next post</a> and in the full guide, <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a>.</p>
<p>When everything you care about matches, the switch itself is short: freeze content, take the final copy, <code>php artisan migrate --<wbr>force</code>, sync uploads, point the domain.</p>
<h2 id="after-the-move-an-agent-on-the-site" tabindex="-1">After the move: an agent on the site <a class="header-anchor" href="#after-the-move-an-agent-on-the-site" aria-label="Permalink to &quot;After the move: an agent on the site&quot;">&ZeroWidthSpace;</a></h2>
<p>Once the site runs on kitloom, it can be run from a chat. kitloom ships an MCP server, so Claude, Cursor or your own agent connects to the site and works with every module: it fixes the 404s the switch left behind, writes the missing meta descriptions, answers form messages, reads the day's orders. It acts as the user whose key it holds, through the same code as the admin. Locked settings stay with people, nothing is deleted for good, and every change is in the activity log. See <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="try-it" tabindex="-1">Try it <a class="header-anchor" href="#try-it" aria-label="Permalink to &quot;Try it&quot;">&ZeroWidthSpace;</a></h2>
<p>Open a sandbox with demo content in one click, <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>, or go straight to your own site with <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a>. What kitloom reads from WordPress and its plugins, and what it does not, is on <a href="https://kitloom.dev/docs/modules/wordpress.html">WordPress Compatibility</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>WordPress plugin data in Laravel: ACF, CF7, WooCommerce, Rank Math</title>
      <link>https://kitloom.dev/blog/plugin-data-after-the-move.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/plugin-data-after-the-move.html</guid>
      <pubDate>Tue, 20 Oct 2026 12:00:00 GMT</pubDate>
      <description>WordPress plugin data in Laravel: kitloom modules read ACF fields, Contact Form 7 forms and Flamingo messages, WooCommerce orders and Rank Math in their own formats.</description>
      <content:encoded><![CDATA[<p>Moving posts and pages out of WordPress is a solved problem. What makes a real site hard to move is everything its plugins wrote: field groups and repeaters, form definitions and years of submissions, products with variations and orders in their own tables, SEO titles and redirect rules.</p>
<p>kitloom's approach is that <strong>a plugin's data is the module's data model</strong>. A module that replaces a plugin reads the plugin's tables, options and meta keys as the plugin left them, and writes them back in the same places. Nothing is imported, so nothing is lost in an importer.</p>
<h2 id="custom-fields-acf-and-secure-custom-fields" tabindex="-1">Custom fields: ACF and Secure Custom Fields <a class="header-anchor" href="#custom-fields-acf-and-secure-custom-fields" aria-label="Permalink to &quot;Custom fields: ACF and Secure Custom Fields&quot;">&ZeroWidthSpace;</a></h2>
<p><code>kitloom/<wbr>custom-<wbr>fields</code> reads ACF's field groups and fields as they are stored, as <code>acf-<wbr>field-<wbr>group</code> and <code>acf-<wbr>field</code> posts, with their location rules. Values stay under the field's meta key with ACF's <code>_<wbr>{name}</code> reference beside it, and options pages stay <code>options_<wbr>{name}</code>. All of ACF's field types are covered, repeaters and flexible content included.</p>
<p>In code a value is <code>$post-<wbr>&gt;field('price')</code>, and a theme gets the fields with the record. Post types and taxonomies made with ACF come along too, through <code>kitloom/<wbr>post-<wbr>types</code>, so their archives and single pages answer at the same addresses.</p>
<h2 id="forms-contact-form-7-and-flamingo" tabindex="-1">Forms: Contact Form 7 and Flamingo <a class="header-anchor" href="#forms-contact-form-7-and-flamingo" aria-label="Permalink to &quot;Forms: Contact Form 7 and Flamingo&quot;">&ZeroWidthSpace;</a></h2>
<p><code>kitloom/<wbr>forms</code> reads each Contact Form 7 form from its <code>wpcf7_<wbr>contact_<wbr>form</code> post: the form markup, both mails, the messages and the additional settings. A <code>[contact-<wbr>form-<wbr>7 id=&quot;…&quot;]</code> shortcode in a page keeps working. Messages Flamingo kept are there as before, filed under the form they came from, and new ones are added the same way. Spam protection (a honeypot and Cloudflare Turnstile) is built in.</p>
<h2 id="the-shop-woocommerce" tabindex="-1">The shop: WooCommerce <a class="header-anchor" href="#the-shop-woocommerce" aria-label="Permalink to &quot;The shop: WooCommerce&quot;">&ZeroWidthSpace;</a></h2>
<p><code>kitloom/<wbr>shop</code> reads WooCommerce's products (simple and variable, with their categories, tags, attributes, prices, SKUs and stock) and its orders from the HPOS tables (<code>wc_<wbr>orders</code>, <code>wc_<wbr>order_<wbr>addresses</code>, <code>woocommerce_<wbr>order_<wbr>items</code> and the rest), plus the <code>woocommerce_<wbr>*</code> settings. A customer signs in with their password and sees their order history. The cart, checkout and My account are drawn by the theme from the shop's own parts.</p>
<p>We compare it with a real WooCommerce store on the same data: a suite of scenarios (coupons, taxes, shipping, stock) runs the same steps on a WooCommerce store and on kitloom over the same data and compares the totals.</p>
<h2 id="seo-and-redirects-rank-math" tabindex="-1">SEO and redirects: Rank Math <a class="header-anchor" href="#seo-and-redirects-rank-math" aria-label="Permalink to &quot;SEO and redirects: Rank Math&quot;">&ZeroWidthSpace;</a></h2>
<p><code>kitloom/<wbr>seo</code> works on Rank Math's options and meta: title and description templates with their <code>%title% %sep% %sitename%</code> variables, each record's own title, description, robots and canonical, the primary category, breadcrumbs, sitemap settings and the verification codes. <code>kitloom/<wbr>redirects</code> uses Rank Math's own redirection and 404-log tables, so every rule the site had keeps redirecting. How that keeps rankings intact is in <a href="https://kitloom.dev/blog/keep-seo-when-leaving-wordpress.html">a post of its own</a>.</p>
<h2 id="and-the-rest" tabindex="-1">And the rest <a class="header-anchor" href="#and-the-rest" aria-label="Permalink to &quot;And the rest&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>Menus, widgets, page templates, synced patterns</strong>: WordPress's own storage, read by the core.</li>
<li><strong>Slide Anything</strong> sliders, with their shortcodes: <code>kitloom/<wbr>slider</code>.</li>
<li><strong>Nextend Social Login</strong>: linked Google and GitHub accounts, <code>kitloom/<wbr>social-<wbr>accounts</code>.</li>
<li><strong>Rank Math's link counter</strong>: <code>kitloom/<wbr>internal-<wbr>links</code>.</li>
<li><strong>Analytics, tag manager, ad pixels, cookie consent</strong> (Site Kit, MonsterInsights, GTM4WP, PixelYourSite, Complianz, CookieYes and others): an <strong>Import</strong> button on the module's settings page takes their settings once.</li>
</ul>
<p>The complete table, with every option and meta key, is on <a href="https://kitloom.dev/docs/modules/wordpress.html">WordPress Compatibility</a>.</p>
<h2 id="each-module-comes-with-tools-for-an-ai-agent" tabindex="-1">Each module comes with tools for an AI agent <a class="header-anchor" href="#each-module-comes-with-tools-for-an-ai-agent" aria-label="Permalink to &quot;Each module comes with tools for an AI agent&quot;">&ZeroWidthSpace;</a></h2>
<p>The plugins' data is not only kept, it can be worked from a chat. Every module above gives kitloom's MCP server tools of its own: custom fields (<code>fields_<wbr>get</code>, <code>fields_<wbr>set</code>), forms and their messages, the shop's products, orders, coupons and sales reports, SEO meta, redirects and the 404 log, sliders, menus and widgets. Claude, Cursor or your own agent uses them with the rights of the user whose key it holds, and every change is in the activity log. See <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</p>
<h2 id="what-a-module-does-not-cover" tabindex="-1">What a module does not cover <a class="header-anchor" href="#what-a-module-does-not-cover" aria-label="Permalink to &quot;What a module does not cover&quot;">&ZeroWidthSpace;</a></h2>
<p>Honesty matters more here than anywhere:</p>
<ul>
<li><strong>A plugin without a module keeps only its data.</strong> Its tables stay in the database, its shortcodes reach the page as text. The <a href="https://kitloom.dev/blog/rehearse-the-move.html">comparison script</a> lists every page where that happens, so you know before the switch.</li>
<li><strong>Yoast SEO and the Redirection plugin are imported, not read in place.</strong> Rank Math's data is read as it is. Yoast's titles, descriptions, robots, canonicals and social meta, and Redirection's rules with their hits, are taken once into Rank Math's keys and tables, with a button in the admin or <code>php artisan seo:<wbr>import --<wbr>from=yoast</code> and <code>php artisan redirects:<wbr>import</code>. The report names what had no place to go: Yoast's scores and Premium redirects, Redirection rules that ask more than the address.</li>
<li><strong>Plugin code does not run.</strong> The data is read by kitloom's own code, rewritten from the data model, not copied from the plugin.</li>
</ul>
<p>When a plugin you depend on has no module, you can write one: <a href="https://kitloom.dev/docs/modules/wordpress.html#a-module-for-a-plugin-s-data">WordPress Compatibility</a> shows how to study what the plugin stores, keep its tables and keys, read both serialized and JSON values, and test against rows exactly as the plugin wrote them. <code>php artisan kitloom:<wbr>make-<wbr>module</code> gives you the package, both admins and the tests to start from.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Test a WordPress to Laravel migration on the live database</title>
      <link>https://kitloom.dev/blog/rehearse-the-move.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/rehearse-the-move.html</guid>
      <pubDate>Tue, 20 Oct 2026 12:00:00 GMT</pubDate>
      <description>Test a WordPress to Laravel migration before it happens: kitloom draws the site from the live database with a read-only MySQL user, and a script compares every page.</description>
      <content:encoded><![CDATA[<p>The worst moment of a migration is the switch, when you find out what the new site does differently. With kitloom you can find out first, on your own data, without touching the live site and without copying anything.</p>
<p>This works because kitloom runs on WordPress's database as it is. If the new application reads the same tables, it can read them while WordPress is still the site.</p>
<h2 id="_1-a-user-that-can-only-read" tabindex="-1">1. A user that can only read <a class="header-anchor" href="#_1-a-user-that-can-only-read" aria-label="Permalink to &quot;1. A user that can only read&quot;">&ZeroWidthSpace;</a></h2>
<p>Create a MySQL user that may read the WordPress database and change nothing:</p>
<div class="language-sql vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sql</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">CREATE</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> USER</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> '</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">kitloom_read</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">'@</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'%'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> IDENTIFIED </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">BY</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'a-long-random-password'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">GRANT</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> SELECT</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> ON</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> wordpress.</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">*</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> TO</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'kitloom_read'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">@</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'%'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span></code></pre>
</div><p>It is safe to hand to whoever does the work: an agency, a freelancer, an AI agent. If the host has a read replica, point it there.</p>
<h2 id="_2-an-application-that-writes-nothing" tabindex="-1">2. An application that writes nothing <a class="header-anchor" href="#_2-an-application-that-writes-nothing" aria-label="Permalink to &quot;2. An application that writes nothing&quot;">&ZeroWidthSpace;</a></h2>
<p>Create a kitloom application and point it at that database, with everything kitloom would normally keep in tables of its own moved off the database:</p>
<div class="language-ini vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ini</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">DB_CONNECTION</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=mysql</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">DB_HOST</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=db.example.com</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">DB_DATABASE</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=wordpress</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">DB_USERNAME</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=kitloom_read</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">DB_PREFIX</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=wp_</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">SESSION_DRIVER</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=array</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">CACHE_STORE</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=array</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">QUEUE_CONNECTION</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=sync</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">PULSE_ENABLED</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=false</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D"># Images straight from the live site, so nothing is copied</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">MEDIA_UPLOADS_URL</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">=https://example.com/wp-content/uploads</span></span></code></pre>
</div><p>Run <code>php artisan serve</code> and open it. Every public address works: posts, pages, archives, search, a missing page, <code>robots.<wbr>txt</code>, the sitemaps, the REST API under <code>/<wbr>wp-<wbr>json/</code>, drawn by the kitloom theme you picked. Change something in <code>wp-<wbr>admin</code> and it shows in kitloom at once, because both read the same rows.</p>
<p>What waits for later is everything that writes (the admin, forms, the cart), since that needs kitloom's own tables. The details, including the one module to leave out in this mode, are in <a href="https://kitloom.dev/docs/migrate-from-wordpress.html#_2-a-first-look-read-only">Migrate from WordPress</a>.</p>
<h2 id="_3-compare-address-by-address" tabindex="-1">3. Compare, address by address <a class="header-anchor" href="#_3-compare-address-by-address" aria-label="Permalink to &quot;3. Compare, address by address&quot;">&ZeroWidthSpace;</a></h2>
<p><code>compare-<wbr>sites.<wbr>php</code> is one PHP file with no dependencies. It sends only <code>GET</code> requests to both sites and writes down what differs:</p>
<div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> -O</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> https://kitloom.dev/migrate/compare-sites.php</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">php</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> compare-sites.php</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --old=https://example.com</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --new=http://localhost:8000</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> --save-html</span></span></code></pre>
</div><p>It takes the addresses from both sites' sitemaps, a few probes and any list you give it (the most visited pages from Analytics or Search Console are a good one), and checks for each:</p>
<ul>
<li>the <strong>status code</strong> and where a <strong>redirect</strong> leads;</li>
<li><strong>robots</strong> (an error when one side says <code>noindex</code>), <strong>title</strong>, <strong>description</strong> and <strong>canonical</strong>;</li>
<li>the record's <strong>content</strong>, as the words a visitor reads, from WordPress's REST API against kitloom's page JSON by the same ID;</li>
<li><strong>leftovers</strong>: <code>[shortcodes]</code> and block comments that reached the page undrawn, the sign of a plugin with no kitloom module;</li>
<li>on archives, the blog and search, whether the <strong>same posts are listed in the same order</strong>.</li>
</ul>
<p>The report, <code>compare-<wbr>report/<wbr>report.<wbr>md</code>, groups everything by check and lists the worst addresses first. Since both sites read the same data at the same moment, every difference is kitloom's, never the content's. Fix, run again, until only what you accept is left. The exit code is 1 while there are errors, so the run can sit in CI.</p>
<h2 id="_4-let-an-agent-look-at-it" tabindex="-1">4. Let an agent look at it <a class="header-anchor" href="#_4-let-an-agent-look-at-it" aria-label="Permalink to &quot;4. Let an agent look at it&quot;">&ZeroWidthSpace;</a></h2>
<p>A script reads markup. A gallery that does not open, a menu in the wrong order or a price without its currency needs eyes. An agent with a browser (Claude Code, Cursor, anything with a Playwright MCP server) does that pass well. The guide has <a href="https://kitloom.dev/docs/migrate-from-wordpress.html#_4-an-ai-agent-s-pass">a ready prompt</a> that keeps it read-only on the live site, makes it group findings by cause rather than by page, and asks for a report you can act on.</p>
<h2 id="_5-then-a-copy-then-the-switch" tabindex="-1">5. Then a copy, then the switch <a class="header-anchor" href="#_5-then-a-copy-then-the-switch" aria-label="Permalink to &quot;5. Then a copy, then the switch&quot;">&ZeroWidthSpace;</a></h2>
<p>For the admin, forms and redirects, take a copy of the database with the same read-only user (<code>mysqldump --<wbr>single-<wbr>transaction</code>), run <code>php artisan migrate</code> on the copy and sign in with your WordPress email and password. Rehearse the switch there: sync the uploads, save a few posts, send the contact form, place a test order, time it all. The switch itself is the same steps on the real database.</p>
<p>At no point before the last step does the live site change. That is the difference between a migration you rehearse and one you hope for.</p>
<p>The whole procedure, with every command: <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Why we built a WordPress-shaped CMS for Laravel</title>
      <link>https://kitloom.dev/blog/why-a-wordpress-shaped-cms-for-laravel.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/why-a-wordpress-shaped-cms-for-laravel.html</guid>
      <pubDate>Tue, 20 Oct 2026 12:00:00 GMT</pubDate>
      <description>Laravel teams keep inheriting WordPress sites, and every rewrite stalls on the data. So we built a Laravel CMS that runs on the WordPress database instead of importing from it — what that took, and what it is not.</description>
      <content:encoded><![CDATA[<!-- TODO before publishing: the real origin story in two or three sentences (which site, what went wrong with the rewrite) in place of the general one under "The itch". Then copy to dev.to with canonical_url pointing here, and to r/laravel. -->
<h1 id="why-we-built-a-wordpress-shaped-cms-for-laravel" tabindex="-1">Why we built a WordPress-shaped CMS for Laravel <a class="header-anchor" href="#why-we-built-a-wordpress-shaped-cms-for-laravel" aria-label="Permalink to &quot;Why we built a WordPress-shaped CMS for Laravel&quot;">&ZeroWidthSpace;</a></h1>
<p>If you write Laravel for a living, you have probably been handed a WordPress site. The client wants &quot;the same site, but in Laravel&quot;. It has ten years of posts, an ACF setup somebody built in 2016, a WooCommerce shop, a contact form whose messages the sales team still reads, and URLs that Google has known for a decade.</p>
<p>The code is the easy part. The data is what eats the budget.</p>
<h2 id="the-itch" tabindex="-1">The itch <a class="header-anchor" href="#the-itch" aria-label="Permalink to &quot;The itch&quot;">&ZeroWidthSpace;</a></h2>
<p>Every time, a rewrite ran into the same wall. We had to design new tables for content that already had a perfectly good shape, then write an importer for <code>wp_<wbr>postmeta</code> and for options stored as PHP <code>serialize()</code>. After that came ACF's field references, WooCommerce's order tables, and the redirect rules from an SEO plugin. Then we had to test that importer on the real database, freeze the content, run it one last time, and chase the URLs that came out different.</p>
<p>At some point the obvious question came up: why move the data at all? WordPress's schema has held up for twenty years. What people want to leave is the code around it, not <code>wp_<wbr>posts</code>.</p>
<h2 id="what-we-considered" tabindex="-1">What we considered <a class="header-anchor" href="#what-we-considered" aria-label="Permalink to &quot;What we considered&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>Rewrite and import.</strong> The usual way. It works, but it is a project of its own, and the import is the part that loses things.</li>
<li><strong>Headless WordPress.</strong> It keeps the data and puts Laravel or a JS front in front of the REST API. But WordPress, its plugins and their updates are all still there.</li>
<li><strong>Eloquent models over the WordPress tables.</strong> There are packages that do this, and they are a good start. But a site is more than models. It also needs permalinks, the main query, canonical redirects, the template hierarchy, sign-in with WordPress passwords, roles, menus and widgets, and the plugins' data.</li>
<li><strong>An existing Laravel CMS.</strong> Statamic, Filament-based CMSs and others are good products with their own content models. For a WordPress site, that means the import again (<a href="https://kitloom.dev/blog/kitloom-vs-statamic.html">kitloom vs Statamic</a> goes through where each one fits).</li>
</ul>
<h2 id="what-we-built" tabindex="-1">What we built <a class="header-anchor" href="#what-we-built" aria-label="Permalink to &quot;What we built&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom is a Laravel CMS whose storage <em>is</em> the WordPress database. Point it at one and run <code>php artisan migrate</code>. That adds kitloom's own tables and leaves WordPress's rows as they are. The same site then answers at the same URLs, and users sign in with the passwords they had.</p>
<p>Inside, there is no WordPress code: no hooks, no <code>wp-<wbr>admin</code>. It is ordinary Laravel:</p>
<ul>
<li><strong>Eloquent models over the WordPress tables.</strong> The models speak Laravel names (<code>$post-<wbr>&gt;title</code>, <code>$post-<wbr>&gt;field('price')</code>, <code>Settings::<wbr>get()</code>). Writers fill slugs and dates and check permissions, and events fire on publish, trash and delete.</li>
<li><strong>Requests handled the way WordPress handles them.</strong> Rewrite rules come from the permalink settings, then the main query and the template hierarchy. The themes are Blade, Vue or React through Inertia. Every page can also answer as JSON or Markdown.</li>
<li><strong>Modules that read plugins' data in the plugins' own formats.</strong> ACF for custom fields, Contact Form 7 and Flamingo for forms, WooCommerce for the shop, Rank Math for SEO and redirects, and others.</li>
<li><strong>Two admins, Filament or Nova, with the same core and modules.</strong> Every module is a Composer package with an admin for each.</li>
<li><strong>An MCP server, so an AI agent can work on the site.</strong> The agent has the rights of the user it acts as.</li>
</ul>
<h2 id="the-hard-parts" tabindex="-1">The hard parts <a class="header-anchor" href="#the-hard-parts" aria-label="Permalink to &quot;The hard parts&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>Serialized PHP everywhere.</strong> kitloom reads it (never as objects) and writes JSON from then on. That is also why the move is one way: WordPress does not read the JSON back.</li>
<li><strong>The edges of WordPress's URL handling.</strong> Pages nested under pages, attachment pages and paged archives behave as WordPress does, and so does the canonical 301 from <code>?p=123</code>. We compare kitloom with WordPress page by page on the same database, and that script is now <a href="https://kitloom.dev/blog/rehearse-the-move.html">part of the migration guide</a>.</li>
<li><strong>Plugin formats that are documented nowhere but in the plugin's code.</strong> We rewrote each one from the data model, without copying plugin code. We studied what the plugin writes, saved those rows as fixtures, and tested against them.</li>
<li><strong>Not becoming WordPress.</strong> It is tempting to rebuild hooks. We used Laravel's own tools instead: contracts, container tags and events.</li>
</ul>
<h2 id="what-it-is-not" tabindex="-1">What it is not <a class="header-anchor" href="#what-it-is-not" aria-label="Permalink to &quot;What it is not&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>It does not run WordPress plugins or themes.</strong> A plugin's data comes along when there is a module for it.</li>
<li><strong>It has no block editor.</strong> Existing blocks are drawn, and new content is written in a visual editor.</li>
<li><strong>It is not a CMS with no WordPress in it.</strong> The tables are WordPress's, and we say so on the home page.</li>
<li><strong>It is not free.</strong> kitloom is a paid product, sold once with a year of updates and a 14-day refund. There are sandboxes to try it first. That pays for maintaining dozens of modules against plugins' data formats.</li>
</ul>
<h2 id="try-it-and-tell-us-where-it-breaks" tabindex="-1">Try it, and tell us where it breaks <a class="header-anchor" href="#try-it-and-tell-us-where-it-breaks" aria-label="Permalink to &quot;Try it, and tell us where it breaks&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li>A sandbox with demo content in one click: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a>.</li>
<li>On your own WordPress database, read-only, without touching the live site: <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a>.</li>
</ul>
<p>We are most interested in the sites where it does not work yet, such as a plugin you depend on or a URL that answers differently. That is how the next module gets chosen.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Why kitloom</title>
      <link>https://kitloom.dev/blog/why-kitloom.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/why-kitloom.html</guid>
      <pubDate>Tue, 20 Oct 2026 12:00:00 GMT</pubDate>
      <description>Start from WordPress, grow on Laravel, run it with AI: seven reasons to build your next site on kitloom — an AI agent does the work under your control, your WordPress site comes along or a new one starts in minutes, the code is plain Laravel, and the pages pass Google's Lighthouse checks.</description>
      <content:encoded><![CDATA[<p>There are plenty of ways to build a site in 2026, and most of them work. kitloom's answer fits in one line: <strong>start from WordPress, grow on Laravel, run it with AI.</strong> WordPress is where nearly every site and client begins, so that is where kitloom starts. Laravel is what the site stands on from then on. AI is where sites are going, so that is where it takes them. Here is why we think that is worth your time — each point with something you can check for yourself.</p>
<h2 id="_1-an-ai-agent-does-the-work-under-your-control" tabindex="-1">1. An AI agent does the work, under your control <a class="header-anchor" href="#_1-an-ai-agent-does-the-work-under-your-control" aria-label="Permalink to &quot;1. An AI agent does the work, under your control&quot;">&ZeroWidthSpace;</a></h2>
<p><code>kitloom/<wbr>ai</code> puts an MCP server on the site. Claude, Cursor or your own agent connects to <code>/<wbr>mcp</code>, calls <code>describe_<wbr>site</code>, and then does the work through the same code as the admin: <code>create_<wbr>content</code> for posts and pages, <code>upload_<wbr>media</code>, <code>menu_<wbr>save</code>, <code>redirect_<wbr>from_<wbr>404</code>, <code>product_<wbr>save</code> and <code>orders_<wbr>list</code> — every installed module brings its own tools. Ask it &quot;which addresses gave 404 this week? Redirect the ones that have a new page&quot;, or &quot;fill in the SEO descriptions of the products that have none&quot;.</p>
<p>It acts as the user whose key it holds: an author's key writes drafts, a read-only key only reads, and nothing it does is beyond what that user could do in the admin. The settings that decide who gets in or what code runs on every page are locked, nothing is deleted for good — it goes to the trash — every change is in the activity log, and revoking the key stops it at once. <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a> shows it at work.</p>
<h2 id="_2-start-from-your-wordpress-site-or-a-new-one" tabindex="-1">2. Start from your WordPress site, or a new one <a class="header-anchor" href="#_2-start-from-your-wordpress-site-or-a-new-one" aria-label="Permalink to &quot;2. Start from your WordPress site, or a new one&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Bring the site you have.</strong> kitloom runs on the WordPress database. Not an import, not a copy: the same <code>wp_<wbr>posts</code>, the same options, the same users with the passwords they already have, the same plugin tables. The site answers at the same URLs, so search engines and old links don't notice the move.</p>
<p>You don't have to take that on faith either. kitloom can draw your live site from its database with a read-only user, and a script compares both sites page by page — <a href="https://kitloom.dev/blog/rehearse-the-move.html">the rehearsal</a> happens before anything is switched.</p>
<p><strong>Or start a new one.</strong> <code>php artisan kitloom:<wbr>install</code> asks which modules the site needs, a theme fills it with demo content, and no WordPress is installed. The content takes WordPress's shape — posts, pages, terms, menus, users — which editors know from the first day and AI models know well, and where a client's old WordPress site fits in later.</p>
<h2 id="_3-it-is-laravel-with-nothing-hidden-underneath" tabindex="-1">3. It is Laravel, with nothing hidden underneath <a class="header-anchor" href="#_3-it-is-laravel-with-nothing-hidden-underneath" aria-label="Permalink to &quot;3. It is Laravel, with nothing hidden underneath&quot;">&ZeroWidthSpace;</a></h2>
<p>There is no WordPress code inside: no hooks, no <code>wp-<wbr>admin</code>, no globals. A post is an Eloquent model (<code>$post-<wbr>&gt;title</code>, <code>$post-<wbr>&gt;field('price')</code>), an option is <code>Settings::<wbr>get()</code>, a change to content fires a Laravel event. Every module is a Composer package with its own tests.</p>
<p>So your team works the way it already does — Composer, PHPUnit, queues, Octane, your deploy pipeline — and the next developer who opens the project recognises what they see.</p>
<h2 id="_4-fast-and-clean-by-google-s-measure" tabindex="-1">4. Fast, and clean by Google's measure <a class="header-anchor" href="#_4-fast-and-clean-by-google-s-measure" aria-label="Permalink to &quot;4. Fast, and clean by Google's measure&quot;">&ZeroWidthSpace;</a></h2>
<p>On the same database, kitloom serves a page faster than WordPress: 14.7 ms against 19.6 ms across thirteen pages, and 25 ms against 43 ms once WordPress carries the plugins most sites run. The <a href="https://kitloom.dev/blog/wordpress-vs-kitloom-benchmarks.html">benchmark</a> shows every number and how it was taken.</p>
<p>Speed on the server is half of it. The other half is what a visitor's browser gets. Here is Keystone, one of the themes that come with kitloom, measured by Google Lighthouse on a public demo — as a phone on a slow connection sees it, and on a desktop:</p>
<div class="lesson-videos lesson-videos-single">
<figure>
  <video controls preload="metadata" src="https://media.kitloom.dev/lessons/keystone-theme/site/lighthouse.mp4#t=3"></video>
  <figcaption>Keystone in Lighthouse: performance, accessibility, best practices and SEO</figcaption>
</figure>
</div>
<p>On a phone: ninety-nine for performance and one hundred for accessibility, best practices and SEO, with the first text in about a second and nothing shifting while the page loads. On a desktop, one hundred for all four. That is the theme as it ships, not a page made for the video: canonical URLs, meta tags and structured data come from the core and the SEO module, images that will be the largest thing on screen are fetched first, a map loads only when the visitor scrolls to it, and contrast, link names and heading order are part of how a theme is checked. Open a demo, press Lighthouse in Chrome's developer tools, and see what you get. The <a href="https://kitloom.dev/docs/benchmarks.html#in-the-browser-lighthouse">benchmarks page</a> has the other pages of the theme, how it was measured and how to measure it yourself.</p>
<h2 id="_5-filament-or-nova-—-your-call" tabindex="-1">5. Filament or Nova — your call <a class="header-anchor" href="#_5-filament-or-nova-—-your-call" aria-label="Permalink to &quot;5. Filament or Nova — your call&quot;">&ZeroWidthSpace;</a></h2>
<p>The admin is the one your team already knows. Kitloom for Filament and Kitloom for Nova carry the same core, the same modules and the same themes; only the admin differs. Every module brings a screen for each.</p>
<h2 id="_6-plugins-become-modules-and-keep-their-data" tabindex="-1">6. Plugins become modules, and keep their data <a class="header-anchor" href="#_6-plugins-become-modules-and-keep-their-data" aria-label="Permalink to &quot;6. Plugins become modules, and keep their data&quot;">&ZeroWidthSpace;</a></h2>
<p>A WordPress site is as much its plugins' data as its posts. kitloom's modules read that data in the plugins' own formats: ACF fields, Contact Form 7 forms and Flamingo messages, WooCommerce products and orders, Rank Math's SEO settings and redirects. <a href="https://kitloom.dev/blog/plugin-data-after-the-move.html">Here is what comes over</a> and how.</p>
<p>Around them are the modules a Laravel site needs anyway — languages, bookings, courses, listings, backups, two-factor sign-in, webhooks, a cookie banner that holds trackers back — each installed with Composer and switched off with one setting.</p>
<h2 id="_7-you-see-all-of-it-before-you-pay" tabindex="-1">7. You see all of it before you pay <a class="header-anchor" href="#_7-you-see-all-of-it-before-you-pay" aria-label="Permalink to &quot;7. You see all of it before you pay&quot;">&ZeroWidthSpace;</a></h2>
<p>There is no free tier and no trial clock, because there is nothing held back. One click gives you a <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a> sandbox of your own with every module and theme — no sign-up, no card. The <a href="https://kitloom.dev/docs/introduction.html">documentation</a> is all public, with video lessons for the modules. And if kitloom doesn't fit once you have it on your own site, you get the full amount back within 14 days, no reason needed. <a href="https://kitloom.dev/blog/why-no-free-version.html">Why it works this way</a>.</p>
<h2 id="what-kitloom-is-not" tabindex="-1">What kitloom is not <a class="header-anchor" href="#what-kitloom-is-not" aria-label="Permalink to &quot;What kitloom is not&quot;">&ZeroWidthSpace;</a></h2>
<p>To be fair about it: kitloom doesn't run WordPress plugins or themes — a plugin's data comes along when there is a module for it. It has no block editor; existing blocks are drawn, and new content is written in a visual editor. And the move is one way: kitloom writes arrays as JSON, which WordPress doesn't read back.</p>
<p>If that still sounds like your next site, <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">open a demo</a> — it takes one click.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Why kitloom has no free version</title>
      <link>https://kitloom.dev/blog/why-no-free-version.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/why-no-free-version.html</guid>
      <pubDate>Tue, 20 Oct 2026 12:00:00 GMT</pubDate>
      <description>No free tier, no basic edition, no trial clock. You can see all of kitloom before you pay, and if it isn't worth the money once you've used it, you get all of it back. You make that call, not us.</description>
      <content:encoded><![CDATA[<p>People ask why kitloom costs money from day one, and why there's no free basic edition to start with. Here's the honest answer.</p>
<h2 id="what-i-don-t-want-to-do-to-you" tabindex="-1">What I don't want to do to you <a class="header-anchor" href="#what-i-don-t-want-to-do-to-you" aria-label="Permalink to &quot;What I don't want to do to you&quot;">&ZeroWidthSpace;</a></h2>
<p>You know how it goes. You open an app because there's something you need to get done right now. You sign up, log in, spend your time and go through step after step, and you still haven't worked out whether you need this app at all. Then, in the middle of the job, it stops and asks you to pay a large sum for a whole year up front.</p>
<p>And most of the time you pay. You came to finish something, you've already put the time in, so you buy it on the spot. A while later you're wondering why you needed it.</p>
<p>That bothers me every time it happens to me. I don't mind paying for something once I know I need it. What I mind is paying before I can tell.</p>
<h2 id="so-everything-is-visible-first" tabindex="-1">So everything is visible first <a class="header-anchor" href="#so-everything-is-visible-first" aria-label="Permalink to &quot;So everything is visible first&quot;">&ZeroWidthSpace;</a></h2>
<p>You can see everything kitloom does before you pay anything:</p>
<ul>
<li><strong>The demos.</strong> One click gives you a <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a> sandbox of your own with every module and theme. You don't sign up or give an email address, and you don't need a card.</li>
<li><strong>The documentation</strong>, all of it: how the core works, every module's guide with its video lessons, and how to write a theme or a module.</li>
</ul>
<h2 id="and-then-the-decision-is-yours" tabindex="-1">And then the decision is yours <a class="header-anchor" href="#and-then-the-decision-is-yours" aria-label="Permalink to &quot;And then the decision is yours&quot;">&ZeroWidthSpace;</a></h2>
<p>I could have made a free basic edition, but then I'd be deciding which parts of kitloom to hold back so you'd want the rest. I'd rather sell the whole thing and trust the person buying it.</p>
<p>So here's how it works. You buy kitloom, install it on your own site and your own WordPress database, read the code and build something with it. If it doesn't do what you expected, or you don't like how it's written, or it just doesn't fit how you see your application, write to us within 14 days and you get the full amount back. You don't have to give a reason, and nobody will try to argue you out of it. The terms are on the <a href="https://kitloom.dev/refunds.html">Refunds</a> page.</p>
<p>I'm completely fine with refunds. I'm not hiding them in small print or hoping nobody asks.</p>
<p>What I'm doing is leaving the judgement with you, the developer. After you've used kitloom on your own project, ask yourself honestly whether it was worth what you paid. If it wasn't, ask for your money back, and you'll get it.</p>
<p><em>The owner of kitloom</em></p>
]]></content:encoded>
    </item>
    <item>
      <title>WordPress alternative: a Laravel CMS that keeps your site</title>
      <link>https://kitloom.dev/blog/wordpress-alternative.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/wordpress-alternative.html</guid>
      <pubDate>Tue, 20 Oct 2026 12:00:00 GMT</pubDate>
      <description>A Laravel CMS like WordPress on the WordPress database as it is: same posts, URLs, users and plugin data, nothing to move out — and what you give up for it.</description>
      <content:encoded><![CDATA[<p>Look for a WordPress alternative, or a Laravel WordPress alternative in particular, and you find good products: Laravel CMSs, headless services, static site generators, hosted builders. Almost all of them begin the same way. Export the content, map it to a new model, import it, rebuild the URLs, set up redirects for the ones that changed, ask every editor to reset their password, and find out what the plugins were really storing.</p>
<p>For a five-page brochure site that is an afternoon. For a site with ten years of posts, custom fields, a shop and a contact form whose messages someone still reads, the migration <em>is</em> the project, and it is the reason many teams stay on WordPress longer than they want to.</p>
<p>kitloom takes the other road. It is a CMS on Laravel that runs <strong>on the WordPress database as it is</strong>: <code>wp_<wbr>posts</code>, <code>wp_<wbr>postmeta</code>, <code>wp_<wbr>options</code>, the terms, the users, and the tables of the plugins the site already has. Nothing is exported and nothing is converted. A new application is put in front of the same tables.</p>
<h2 id="why-people-leave-wordpress" tabindex="-1">Why people leave WordPress <a class="header-anchor" href="#why-people-leave-wordpress" aria-label="Permalink to &quot;Why people leave WordPress&quot;">&ZeroWidthSpace;</a></h2>
<p>Usually not because of the content model. Posts, pages, terms and meta have held up for twenty years. The reasons are more often:</p>
<ul>
<li><strong>The code.</strong> Hooks reaching into hooks, a <code>functions.<wbr>php</code> nobody wants to touch, plugins that each bring their own way of doing things. A Laravel team would rather write services, Eloquent models, queues and tests.</li>
<li><strong>The plugin count.</strong> Many business sites run on dozens of plugins, each with its own updates, its own security history and its own idea of the admin.</li>
<li><strong>Hiring and tooling.</strong> A team that already writes Laravel would rather not keep a second stack for one site, and static analysis, CI and a real test suite come naturally there.</li>
<li><strong>The front end.</strong> A Vue or React front, or a site that is also an API for an app, is first-class in Laravel and an afterthought in a WordPress theme.</li>
</ul>
<p>None of these is a reason to throw the content away.</p>
<h2 id="what-stays-the-same" tabindex="-1">What stays the same <a class="header-anchor" href="#what-stays-the-same" aria-label="Permalink to &quot;What stays the same&quot;">&ZeroWidthSpace;</a></h2>
<p>Point kitloom at the database and the site keeps:</p>
<ul>
<li><strong>Its content</strong>: posts, pages, attachments, revisions, categories, tags, custom taxonomies, comments.</li>
<li><strong>Its addresses</strong>: kitloom reads the permalink settings and handles a request the way WordPress does: rewrite rules, the main query, the canonical redirect, the template hierarchy. <code>/<wbr>2019/<wbr>04/<wbr>a-<wbr>post/</code> is still <code>/<wbr>2019/<wbr>04/<wbr>a-<wbr>post/</code>.</li>
<li><strong>Its people</strong>: users sign in with the password they had, because WordPress's password hashes are read as WordPress wrote them, and their roles come along.</li>
<li><strong>Its plugins' data</strong>: ACF field groups and values, Contact Form 7 forms and Flamingo messages, WooCommerce products and orders, Rank Math's titles, sitemaps and redirects, among others. Each is read by a kitloom module in the plugin's own format. The full list is on <a href="https://kitloom.dev/docs/modules/wordpress.html">WordPress Compatibility</a>.</li>
<li><strong>Its settings</strong>: site name, reading settings, menus and their locations, widgets.</li>
</ul>
<h2 id="what-changes" tabindex="-1">What changes <a class="header-anchor" href="#what-changes" aria-label="Permalink to &quot;What changes&quot;">&ZeroWidthSpace;</a></h2>
<p>Everything that is code, and who does the work:</p>
<ul>
<li><strong>An AI agent runs the site, under your control.</strong> kitloom ships an MCP server. Claude, Cursor or your own agent connects to <code>/<wbr>mcp</code>, calls <code>describe_<wbr>site</code>, and does the work through the same code as the admin: <code>create_<wbr>content</code>, <code>upload_<wbr>media</code>, <code>menu_<wbr>save</code>, <code>seo_<wbr>update</code>, <code>redirect_<wbr>from_<wbr>404</code>, <code>product_<wbr>save</code>. Ask it &quot;which addresses gave 404 this week? Redirect the ones that have a new page&quot;. It acts as the user whose key it holds: an author's key writes drafts, a read-only key only reads, and the settings that decide who gets in or what code runs on every page are locked. Nothing is deleted for good, every change is in the activity log, and revoking the key stops it at once. See <a href="https://kitloom.dev/blog/run-your-site-with-an-ai-agent.html">Run your site from Claude or Cursor</a>.</li>
<li><strong>No WordPress PHP.</strong> No hooks, no <code>wp-<wbr>admin</code>, no plugins or themes from WordPress. The admin is <a href="https://kitloom.dev/docs/introduction.html">Filament or Laravel Nova</a>, and every module is a Composer package with an admin for each. If you are weighing Filament's own plugins instead, see <a href="https://kitloom.dev/blog/laravel-filament-plugins-for-a-website.html">Laravel Filament plugins for a full website</a>.</li>
<li><strong>Laravel all the way down.</strong> Eloquent models over the WordPress tables (<code>$post-<wbr>&gt;title</code>, not <code>post_<wbr>title</code>), events, queues, Horizon, Pulse, Pint, PHPStan, PHPUnit.</li>
<li><strong>Any front end.</strong> A theme in Blade, Vue or React, or none: every page also answers as JSON, so the front can be anything. See <a href="https://kitloom.dev/docs/headless.html">Headless &amp; APIs</a>.</li>
<li><strong>Speed.</strong> On the same database the bare core answers faster than a bare WordPress, and the whole kitloom with every module faster than WordPress running three popular plugins (SEO, forms and a shop). The setup and the numbers are on <a href="https://kitloom.dev/docs/benchmarks.html">Benchmarks</a>, including where WordPress is still ahead (search).</li>
</ul>
<h2 id="what-you-give-up" tabindex="-1">What you give up <a class="header-anchor" href="#what-you-give-up" aria-label="Permalink to &quot;What you give up&quot;">&ZeroWidthSpace;</a></h2>
<p>An alternative is only useful if its trade-offs are clear:</p>
<ul>
<li><strong>WordPress plugins do not run.</strong> A plugin's <em>data</em> comes along when kitloom has a module for it. A plugin without a module leaves its data in the database and its shortcodes on the page as text, until a module or a replacement takes over.</li>
<li><strong>Your WordPress theme does not run.</strong> It is PHP written for WordPress. You take a <a href="https://kitloom.dev/docs/themes/catalog.html">bundled theme</a>, <a href="https://kitloom.dev/docs/themes/generator.html">generate one</a>, or <a href="https://kitloom.dev/docs/themes/from-template.html">build one from an HTML template</a>.</li>
<li><strong>No block editor.</strong> Blocks already in content are drawn as WordPress draws them; editors write in a visual editor, not Gutenberg.</li>
<li><strong>The move is one way.</strong> kitloom writes new arrays as JSON, which WordPress does not read. Going back means restoring your backup.</li>
<li><strong>It is WordPress-shaped.</strong> The tables are WordPress's, and a type's model extends <code>Post</code>. If you want a Laravel CMS with no WordPress in it at all, kitloom is not it, and <a href="https://kitloom.dev/docs/wordpress-and-laravel.html">What Is WordPress Here</a> says so in detail.</li>
</ul>
<h2 id="who-it-is-for" tabindex="-1">Who it is for <a class="header-anchor" href="#who-it-is-for" aria-label="Permalink to &quot;Who it is for&quot;">&ZeroWidthSpace;</a></h2>
<p>kitloom fits when the site's content already lives in WordPress, or in that shape, and the team wants Laravel for everything around it: an agency inheriting WordPress sites, a company whose developers moved to Laravel, a WooCommerce shop that has outgrown its plugin stack, a publisher who wants an API and a modern front without a re-platforming project.</p>
<p>The quickest way to judge it is on your own data. <a href="https://kitloom.dev/docs/migrate-from-wordpress.html">Migrate from WordPress</a> shows how to look at your site through kitloom with a read-only database user, so the live site is not touched, and how to compare the two page by page. Or open a sandbox first: <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament demo</a>, <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova demo</a>. Connect an agent to it from the dashboard and give it something to do.</p>
]]></content:encoded>
    </item>
    <item>
      <title>WordPress vs Laravel performance on one database: a benchmark</title>
      <link>https://kitloom.dev/blog/wordpress-vs-kitloom-benchmarks.html</link>
      <guid isPermaLink="true">https://kitloom.dev/blog/wordpress-vs-kitloom-benchmarks.html</guid>
      <pubDate>Mon, 19 Oct 2026 12:00:00 GMT</pubDate>
      <description>WordPress vs Laravel performance on the same MySQL: ten thousand posts served by WordPress and by kitloom. kitloom is faster on most pages, WordPress wins search.</description>
      <content:encoded><![CDATA[<p>kitloom serves a site from its WordPress database: the same <code>wp_<wbr>posts</code>, the same terms, the same comments. So a fair question is whether the same content comes back faster through Laravel than through WordPress. We measured it: one database, the same records, identical containers, thirteen typical pages.</p>
<h2 id="the-setup" tabindex="-1">The setup <a class="header-anchor" href="#the-setup" aria-label="Permalink to &quot;The setup&quot;">&ZeroWidthSpace;</a></h2>
<p>A fresh WordPress filled with the <a href="https://github.com/WordPress/theme-test-data" target="_blank" rel="noreferrer">Theme Unit Test data</a> and generated content — 10,000 posts in 118 categories, 50,000 comments, 20 authors — exported as WXR and imported into an empty kitloom. Both sites read the same records from one MySQL 8 server.</p>
<p>Four sites took part:</p>
<ul>
<li><strong>WordPress</strong> with its default theme and no plugins;</li>
<li><strong>WordPress + plugins</strong>: Yoast SEO, Contact Form 7 and WooCommerce, as many WordPress sites run;</li>
<li><strong>kitloom, lean</strong>: what a bare WordPress has — posts, pages, media, menus, widgets, comments, the REST API, a form module, the Blade theme;</li>
<li><strong>kitloom, full</strong>: the whole Filament skeleton, about 140 packages with every module and the admin.</li>
</ul>
<p>Each runs PHP 8.4 under PHP-FPM with OPcache, behind nginx, and each page was loaded for ten seconds over one connection and then over eight, in three rounds. No page cache on either side for the main numbers: every page is built from the database.</p>
<h2 id="the-numbers" tabindex="-1">The numbers <a class="header-anchor" href="#the-numbers" aria-label="Permalink to &quot;The numbers&quot;">&ZeroWidthSpace;</a></h2>
<p>The median time of one page over one connection, and pages per second over eight:</p>
<table tabindex="0">
<thead>
<tr>
<th>Page</th>
<th>WordPress</th>
<th>WordPress + plugins</th>
<th>kitloom, lean</th>
<th>kitloom, full</th>
</tr>
</thead>
<tbody>
<tr>
<td>Home</td>
<td>20 ms · 364/s</td>
<td>38 ms · 181/s</td>
<td>14 ms · 491/s</td>
<td>27 ms · 270/s</td>
</tr>
<tr>
<td>Post</td>
<td>14 ms · 496/s</td>
<td>32 ms · 214/s</td>
<td>13 ms · 557/s</td>
<td>25 ms · 277/s</td>
</tr>
<tr>
<td>Post with 2,167 comments</td>
<td>285 ms · 22/s</td>
<td>310 ms · 23/s</td>
<td>196 ms · 34/s</td>
<td>219 ms · 32/s</td>
</tr>
<tr>
<td>Category</td>
<td>19 ms · 338/s</td>
<td>35 ms · 180/s</td>
<td>16 ms · 387/s</td>
<td>29 ms · 223/s</td>
</tr>
<tr>
<td>Search</td>
<td>44 ms · 123/s</td>
<td>86 ms · 81/s</td>
<td>59 ms · 122/s</td>
<td>73 ms · 99/s</td>
</tr>
<tr>
<td><strong>All 13 pages</strong></td>
<td><strong>21.4 ms · 303/s</strong></td>
<td><strong>44.8 ms · 148/s</strong></td>
<td><strong>18.3 ms · 345/s</strong></td>
<td><strong>32.8 ms · 199/s</strong></td>
</tr>
</tbody>
</table>
<p>It ran on one laptop (an M4 Pro under Docker Desktop), so read the ratios rather than the milliseconds. The rounds of WordPress and the full kitloom were 8–9 % apart, those of WordPress with plugins 16 %; one lean round ran beside another job and came out far slower, and the median of three leaves it out.</p>
<p>These are the numbers of 2026-10-29. The first version of this post, a week and a half earlier, had 14.7 ms for lean and 25 ms for full against 19.6 ms for WordPress: 0.75 and 1.28 times WordPress's time, now 0.86 and 1.53. The full skeleton has gained about twenty modules since, and each costs a little on every page. The Redis and page-cache figures below come from that earlier run.</p>
<h2 id="what-stands-out" tabindex="-1">What stands out <a class="header-anchor" href="#what-stands-out" aria-label="Permalink to &quot;What stands out&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>Like for like, kitloom is faster.</strong> With what a bare WordPress has, kitloom answers in 18.3 ms against 21.4 ms across the thirteen pages and serves 1.1 times as many pages a second. A post runs 19 SQL queries against WordPress's 25: menus are built only for the places a page draws them, so a migrated site with a dozen forgotten menus does not pay for them.</p>
<p><strong>Plugins cost WordPress more than packages cost kitloom.</strong> Three plugins more than double WordPress's time for a post, 14 → 32 ms. Everything the full kitloom skeleton adds to the lean one — about 130 packages and the admin — costs about 14 ms a page, most of it starting them. The full kitloom still comes in at 32.8 ms against 44.8 ms for WordPress with its plugins, 1.3 times as many pages a second.</p>
<p><strong>WordPress still wins search.</strong> 44 ms against 59–73 ms. Both look for the words with <code>LIKE '%…%'</code> in every post's HTML, which no index can serve. WordPress reads the posts once and asks MySQL how many rows it found; kitloom reads them twice, once to count the results for the page links and once for the page, the way Laravel paginates on every database it supports. On ten thousand posts that is the whole difference; a site with a few thousand pays a few milliseconds, and a large one that needs fast search gives <a href="https://kitloom.dev/docs/modules/guides/search.html">kitloom/search</a> Meilisearch or Typesense.</p>
<p><strong>Redis helps WordPress, not kitloom.</strong> WordPress keeps posts, terms and query results in its object cache, so Redis takes most of its SQL away and makes search three times faster. kitloom reads only its settings and a few small lists from the cache: with Redis its pages came out the same as with files.</p>
<h2 id="with-a-page-cache" tabindex="-1">With a page cache <a class="header-anchor" href="#with-a-page-cache" aria-label="Permalink to &quot;With a page cache&quot;">&ZeroWidthSpace;</a></h2>
<p>Both sides can keep finished pages. WordPress with a page-cache plugin and kitloom with its stored page sent before Laravel starts come back in the same 0.2 ms — around 20,000 pages a second. Sent through Laravel instead, a stored kitloom page costs the framework's start: 1.4 ms on the lean site, 7 ms on the full skeleton. kitloom also keeps search results, which the plugin does not.</p>
<h2 id="try-it-on-your-own-data" tabindex="-1">Try it on your own data <a class="header-anchor" href="#try-it-on-your-own-data" aria-label="Permalink to &quot;Try it on your own data&quot;">&ZeroWidthSpace;</a></h2>
<p>Numbers from someone else's laptop are a starting point. The <a href="https://kitloom.dev/docs/benchmarks.html">benchmarks page</a> has every table, the versions, the content and how each figure was taken, and the advice for a live site: <code>php artisan optimize</code> on every deploy, the page cache on, and the modules a site does not use left out.</p>
<p>Or open a <a href="https://filament.kitloom.dev/new" target="_blank" rel="noreferrer">Filament</a> or <a href="https://nova.kitloom.dev/new" target="_blank" rel="noreferrer">Nova</a> demo and click around a kitloom site of your own.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
