GuidePremium
Multi blog and multi language in CoullWorks Blog for Laravel
Run several blogs from one install on their own domains or paths, publish each in several languages, and see how the language in the address, translations, hreflang and per-language slugs work.
Updated 17 November 2026Back to the package pageBuy
One install can run any number of blogs, and each blog can publish in any number of languages. They are two separate ideas that work together: a blog is a whole publication with its own posts, settings and address; a language is a version of one blog's content.
Several blogs from one install#

The top bar of the admin with a second blog chosen. The switcher on the right reads Atelier. Everything on the screens below it (posts, categories, settings, the dashboard numbers) now belongs to Atelier.

The same top bar with Field Notes chosen, on the Dashboard. Switching reloads the page you are on for the other blog.
What a blog owns#
A blog is a row with a name, a slug, a default language, a list of enabled languages, a time zone, an optional domain, a path prefix, an active switch and a default marker. Each blog has its own posts, categories, tags, redirects, comments and settings. A setting changed on one blog does not change another.
Create and edit blogs in Tools, Settings, Blogs and domains. Every field is explained in Blogs and domains.
Which blog answers a request#
On the public site the package picks the blog from the address. The rule, in order:
- Take the active blogs whose Domain equals the host of the request (case does not matter). Of those, take the one whose Path prefix matches the start of the path. If several match, the longest prefix wins. A prefix of
/matches every path. - If no blog has that domain, do the same among blogs with an empty domain.
- If still nothing matches, use the default blog.
An inactive blog never answers. Some ways to use it:
| You want | Set |
|---|---|
One blog at example.com/blog | Domain example.com, path prefix blog |
| A second blog on its own domain | Domain atelier.example.com, empty prefix |
| Two blogs on one domain | The same domain, prefixes news and guides |
| A blog on any host, such as a local test site | Empty domain |

The public home page of the second blog, Atelier, on its own address. It has its own name in the header, its own three posts and no category pills row.
In the admin, the active blog is the one you chose in the switcher. The switcher appears only when more than one blog exists. Your choice is kept in your session. With no choice, the panel uses the blog the address resolves to, then the default blog.
With the Inertia front end, a blog that has its own domain needs its own route group. Run php artisan blog:inertia:install with --domain=atelier.example.com=prefix, or let it read the domains from the database. See Inertia front end.
Several languages in one blog#

The Translations tab of the post editor. One tab per extra language, here FR. It has its own Title ("Comment choisir une tente trois saisons"), Slug ("choisir-une-tente-trois-saisons"), Excerpt and a list of blocks, and a Copy from default button under the list.
Turn languages on#
- Open Tools, Settings, Blogs and domains and edit the blog.
- Set Default language (the language the content is first written in) and add the others to Languages. The default must be in the list.
- Save. Every post, category and tag of this blog now has a tab for each extra language.
Translate a post#
- Open the post. A Translations tab appears, with one tab per language other than the default.
- Press the language tab, for example FR. Fill Title, Slug, Excerpt and the blocks.
- To start from the default language, press Copy from default. It copies the title, the excerpt and the blocks (not the slug). Then translate the text in place.
- Save. The language version is stored with the post.
The fields are in the post editor. Categories and tags are translated in the same way, with an EN and an FR tab for the name, slug, description, image alt text and SEO fields:

The category editor for Gear in the Atelier blog. Language tabs EN and FR sit above the Name and Slug fields. The search preview at the bottom shows the address atelier.workbench.test/en/category/gear, with the language in the path.
What the reader sees#

The French version of the tent article on Atelier: the same layout with a French title, standfirst, "Dans ce guide" contents, headings, table and questions, and a rail with "A retenir" (the key takeaways) and "About the authors".
- The language is in the address. By default, patterns carry
{locale}: a post is/en/choose-a-tentor/fr/choisir-une-tente-trois-saisons. A pattern also matches without its{locale}part, and that means the blog's default language. The patterns are incoullworks-blog.urls.patterns. - Each language has its own slug. The same post can have a different address in each language, as the screenshot above shows.
- A language that is not enabled for the blog does not match, so
/de/...is not found if German is off. - A page missing in a language is not found, but the not found page then lists the languages that do have it, as small pills linking to each (see the not found view).
- The interface text (Home, Search, Page not found) comes from the package's language files, which ship in English only. Publish them and translate them as described in Choosing a front end.
- Feeds, sitemap and search are per language. Feeds are
feed/{locale}.xml. Search looks only in the language of the page. Forja,zh,koandthsearch uses a plain text match instead of full-text search, because those languages have no spaces between words. Change the list withcoullworks-blog.search.like_locales.
The public layout has a language switcher that links a reader to the other languages. See Language switcher.
hreflang#
When the SEO setting hreflang is on (it is by default), the head of a post carries one <link rel="alternate" hreflang="..."> for every language the post exists in, including its own, and an x-default that points to the blog's default language. Category and tag pages do the same for their languages. The sitemap carries the same alternates for each address. Search engines use them to send each reader to their own language.
Turn the setting on or off per blog in SEO settings (field key seo.output.hreflang).
A post lists only the languages it has a translation in, so no alternate points to a page that does not exist.
Language switcher#

The header of the French article on Atelier. The switcher on the right lists English and Français as small pills; the current language is bold and has a darker fill.
A blog that publishes in more than one language shows a language switcher in the header of every public page, on every front end (Blade, Livewire and Inertia). It is a short list of plain links, one for each language the blog has switched on.
What it does#
- It appears only when there is a choice. A blog with one language shows nothing. With two or more it shows one link per enabled language, in the order set on the blog.
- A link goes to the same page in the other language. On a post, a language that has a translation links to that translation, at its own address and slug. On a category or tag page it links to the translated category or tag. A language that has no translation of the page links to the blog's home page in that language, so a reader is never sent to a page that is not found.
- The home page, authors, archives and search have no translation of their own, so each language links to its home page. The one you are reading is marked as current.
- Each link is labelled in its own language (English, Français, Deutsch), so a reader finds theirs without knowing the English name. A code the package has no name for shows the code in capitals.
- It is accessible. The list sits in a
navwith the label "Languages". Each link haslangandhreflangset to its language code, and the current language hasaria-current="page". The links are real links with a visible focus and a target of at least 24 pixels. - It needs no JavaScript. There is no menu, button or script: every language is an ordinary link, so it works with scripts blocked and in a search engine's crawl. The draft preview page does not show it.

The same switcher on a phone, 390 pixels wide, on the Atelier home page. The pills wrap under the blog name and the current language, English, is bold.
Turn it off#
The switcher is on by default. Set language_switcher to false in config/coullworks-blog.php (publish the file with php artisan vendor:publish --tag=cwb-config):
'language_switcher' => false,With it off, no front end draws the switcher. The hreflang links in the page head are a separate setting (see hreflang) and stay as they are.
Change where it sits or how it looks#
The default layout draws the switcher in the header, after the main menu, with the <x-cw::language-switcher> component. Both view sets (Tailwind and Bootstrap) have it, with the same element tree.
- Change its markup or classes. Publish the views (
php artisan vendor:publish --tag=cwb-blade-views-tailwindorcwb-blade-views-bootstrap) and editresources/views/vendor/coullworks-blog/components/language-switcher.blade.php. The view receives$links, a list where each entry haslocale,label,urlandcurrent. Livewire uses the same view. - Move it. Publish the layout (
layouts/default.blade.php) and put<x-cw::language-switcher :links="$languageLinks ?? []" />where you want it, for example in the footer. If you use your own layout (blade.layout), add the same line to it. See Views you can override. - With Inertia, each page gets the list as
blog.languages(the same four fields). The stubs include aLanguageSwitchercomponent that theLayoutcomponent renders in the header, in React and Vue and in both styles. Edit that component, or render your own fromblog.languages.
Check it works#
- Open the blog in a browser and note the address of one post.
- Change the language part of the address to the other language. You should see the translation. A language you have not translated should show the not found page with a language link.
- View the page source and search for
hreflang. You should see every language and anx-default. - Look at the header: the language switcher should list each language, with the current one marked. Follow the link for the other language and check that you land on the translation.
- Open the other blog on its own address. It should show its own posts and name.







