Skip to content
Available for new work
Pages in Blog

GuidePremium

The Blade front end for CoullWorks Blog for Laravel

Install and configure the server-rendered Blade pages, choose the Tailwind or Bootstrap view set, set every key in the blade config, and control embed consent.

Updated 16 November 2026Back to the package pageBuy

The Blade front end is the default. It draws the blog home page, article, category, tag, author, archive, search and not-found pages, and serves the feed and the sitemap. Every page is server-rendered HTML, so it works without JavaScript and is read by search engines as it is.

Turn it on and see it#

The blog home page: header, category pills, a wide lead post and a grid of cards

The Blade home page at 1440 pixels: header with the blog name, Home and Search; the All pill selected among the category pills; the lead post with its image on the left; a three-column grid below; the footer with the copyright line and the RSS feed link.

  1. Open config/coullworks-blog.php (publish it with php artisan vendor:publish --tag=cwb-config if it is not there).
  2. Set 'frontend' => 'blade'. This is already the default.
  3. Open the blog address in a browser. The pages are styled at once: the package ships the compiled stylesheet, so there is nothing to build.

The same home page at 390 pixels: one column of cards

The home page on a phone: the category pills wrap onto two lines and the cards stack in one column.

The pages are described one by one in Views you can override. The layout around them is in Tokens and theming.

Choose the view set: Tailwind#

An article drawn by the Tailwind view set: contents rail on the left, text on the right

The article page from the Tailwind view set. The rail on the left holds On this page, Key takeaways and About the authors; the text sits in the column on the right.

coullworks-blog.blade.framework chooses the view set. Allowed values are tailwind (the default) and bootstrap. Both sets draw the same pages with the same element tree. Only the class names differ.

With Tailwind there are two ways to style the blog.

  • Use the shipped stylesheet (default). The package serves dist/blog-tailwind.css, compiled from its own views with only the classes they use, plus the tokens, the adapter and blog.css. The default layout links it at /vendor/coullworks-blog/blog-tailwind.css. Run php artisan cwb:blade-install once and the file is published to public/vendor/coullworks-blog/, so your web server can serve it directly. Run the command again after you update the package.
  • Build the classes with your own Tailwind 4. Set coullworks-blog.blade.compiled_css to false. The layout then links only tokens.css and blog.css. Tailwind 4 does not scan the vendor directory, so tell it where the views are. Run php artisan cwb:blade-install: it prints the @source line and the adapter import to add to resources/css/app.css. Or publish the views with php artisan vendor:publish --tag=cwb-blade-views-tailwind and your own build scans them. The adapter maps the --cw-* tokens into your Tailwind @theme.

Choose the view set: Bootstrap 5#

The blog home page, captured from the Tailwind set; the Bootstrap set draws the same element tree

There is no separate Bootstrap capture in the gallery. This is the Tailwind capture of the same page; the Bootstrap set draws the same element tree and takes its colours and sizes from the same tokens.

Set coullworks-blog.blade.framework to bootstrap. Nothing to build and no Bootstrap of your own to load: the package ships dist/blog-bootstrap.css (Bootstrap 5.3.8, then the tokens, the adapter and blog.css) and the default layout links it. No Bootstrap JavaScript is used.

To reuse the Bootstrap your application already loads:

  1. Set coullworks-blog.blade.compiled_css to false.
  2. Run php artisan vendor:publish --tag=cwb-blade-tokens --tag=cwb-blade-adapters --tag=cwb-blade-js.
  3. Load the published tokens.css, adapter-bootstrap.css and blog.css after Bootstrap's CSS, all from public/vendor/coullworks-blog/.

The Bootstrap --bs-* variables then drive the tokens, and data-bs-theme="dark" switches the blog to its dark colours.

Every key in the Blade config#

Publish the file with php artisan vendor:publish --tag=cwb-blade-config. It is written to config/coullworks-blog-blade.php. The same keys can instead be set in the blade array inside config/coullworks-blog.php, and that array wins.

KeyDefaultAllowed valuesWhat it changes
frameworktailwindtailwind, bootstrapThe view set every page and component uses
compiled_csstruetrue, falsetrue: the layout links the stylesheet the package ships. false: it links tokens.css and blog.css only, for a host that builds its own classes
layoutnulla Blade layout name, or nullYour own layout. It must @yield('content') and @stack('cw-head'). null uses the package layout
middleware['web']a list of middleware namesRoute middleware, run before the package's blog, licence and preview middleware
max_age0secondsBrowser cache lifetime of public pages. 0 means the browser asks again with the ETag on every visit, so a post published a moment ago is never hidden
s_maxage600secondsHow long a CDN or proxy may keep a public page
railtruetrue, falseWhether a post left on "Blog default" uses the rail layout. Applies until the setting template.default is stored; after that the setting decides
featured_count10 to 3How many featured posts the home page shows as lead cards
load_morefalsetrue, falsetrue: listings end with a Load more link to the next page instead of numbered pagination
components.searchcw::search-forma Blade component nameThe search box. Livewire replaces it with cwl::search
components.paginationcw::paginationa Blade component nameThe numbered pager. Livewire replaces it with cwl::pagination
components.load_morecw::load-morea Blade component nameThe Load more link. Livewire replaces it with cwl::load-more
components.listcw::lista Blade component nameThe list wrapper under a listing. Livewire replaces it with cwl::list
preview_pattern{locale}/preview/{token}a URL patternUsed for the preview route when the core preview pattern has no {token}
consent_cookiecwb_consenta cookie nameThe first-party cookie that holds the reader's embed consent
sharex, linkedin, facebook, bluesky, emailany of those, in the order to showThe share links on an article
recent5a whole number of 1 or moreHow many posts the Recent posts widget lists

Public pages carry an ETag and Cache-Control headers built from max_age and s_maxage. A preview page is never cached publicly.

A Spotify embed replaced by a notice and a Load Spotify content button

What a reader sees in place of an embed before consenting: a grey box saying the content is hosted by Spotify and that loading it shares data with them, with one orange button, Load Spotify content.

Video (YouTube and Vimeo) and Embed blocks never send a reader's browser to the provider until the reader agrees. The page shows the notice above instead. Agreeing works like this.

  1. The reader presses the button. The page script adds the provider name to a cookie, loads the player in place, and shows a revoke link in the footer.
  2. The cookie is named by blade.consent_cookie (cwb_consent by default). Its value is a comma-separated list of provider names. It lasts 365 days, applies to the whole site and is SameSite=Lax.
  3. On the next visit the player loads at once for every provider in the cookie.
  4. The reader can withdraw consent with the revoke link in the footer, which clears the cookie and reloads the page.

On the server, the default checker is DenyAllConsent: a server-rendered page never carries a provider address. If your site already has a cookie banner, either write the provider names into this cookie from your banner, or bind your own class to the ConsentChecker contract so the server may render the player directly. The contract is in the contracts reference. Which providers are allowed at all is set in Settings under Allowed providers.

The layout#

The default layout is a skip link, a header with the blog name and the Home and Search links, a main region and a footer with the copyright line and the feed link. To use your own, set blade.layout to your Blade view. It must contain @yield('content') and @stack('cw-head'). The head tags (title, canonical, hreflang, structured data) are pushed into cw-head, so leave that stack in your <head>. The page slots you can fill are described in Views you can override.

Screenshots of the Bootstrap view set#

The Bootstrap set draws the same pages as Tailwind with Bootstrap's own look: links are blue on a white page where Tailwind uses an orange accent on a grey one. The Blade Bootstrap blog home page at 1440 px: header, category pills, a lead post and cards

The Blade Bootstrap listing on a 1440 px window.

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

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

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

The Blade Bootstrap article page at 1440 px.

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

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

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

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

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

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

Available for new work

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