PHPackages                             marshmallow/multi-language - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. marshmallow/multi-language

Abandoned → [marshmallow/translatable](/?search=marshmallow%2Ftranslatable)ArchivedLibrary[Localization &amp; i18n](/categories/localization)

marshmallow/multi-language
==========================

Vertalen

v1.0.3(5y ago)081MITPHPPHP ^7.4

Since May 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/marshmallow-packages/multi-language)[ Packagist](https://packagist.org/packages/marshmallow/multi-language)[ Docs](https://github.com/Marshmallow-Development/)[ RSS](/packages/marshmallow-multi-language/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

[![alt text](https://camo.githubusercontent.com/329958cb02b7bee461fd9dcae7a0a3a34e6595669116ff441ad5ef9e77bc511c/68747470733a2f2f63646e2e6d617273686d616c6c6f772d6f66666963652e636f6d2f6d656469612f696d616765732f6c6f676f2f6d617273686d616c6c6f772e7472616e73706172656e742e7265642e706e67 "marshmallow.")](https://camo.githubusercontent.com/329958cb02b7bee461fd9dcae7a0a3a34e6595669116ff441ad5ef9e77bc511c/68747470733a2f2f63646e2e6d617273686d616c6c6f772d6f66666963652e636f6d2f6d656469612f696d616765732f6c6f676f2f6d617273686d616c6c6f772e7472616e73706172656e742e7265642e706e67)

Marshmallow Pages
=================

[](#marshmallow-pages)

Deze package geeft de mogelijkheid om gemakkelijk pagina's te beheren in Laravel. Dit is eigelijk een verzameling van handinge composer packages van derde en samengevoegd om snel te kunnen hergebruiken.

### Installatie

[](#installatie)

```
composer require marshmallow/multi-language

```

Run `php artisan migrate` to create the languages table where we will store the languages. Run `php artisan marshmallow:resource Language MultiLanguage` to create the Nova resources so you can add more languages if needed. Add `MultiLanguageMiddleware` to your `app/Http/Kernel.php` so the language that is picked by your visitor can be stored in a session and will be retreived on every request.

```
protected $middlewareGroups = [
    'web' => [
        //...
        \Illuminate\Session\Middleware\StartSession::class,

        /**
         * Make sure you put this below the StartSession middleware
         */
        \Marshmallow\MultiLanguage\Http\Middleware\MultiLanguageMiddleware::class,

        //...
    ],
```

Migrate
-------

[](#migrate)

If you have content in a table that needs to be made translatable, you can run the artisan command below: `php artisan marshmallow:translate-resource Marshmallow\\Pages\\Models\\Page`

Add the language switcher to Nova
---------------------------------

[](#add-the-language-switcher-to-nova)

Add the language tool to your `NovaServiceProvider` so you can switch the language you are working on. This is not required but is a good helper.

```
public function tools()
{
    return [
        new \Digitalcloud\MultilingualNova\NovaLanguageTool,
    ];
}
```

If you use this, you need to publish the config for this package so you can tell this package it can get the languages from the database. Run `php artisan vendor:publish --provider="Digitalcloud\MultilingualNova\FieldServiceProvider" --tag=config`. Run `php artisan vendor:publish --provider="Spatie\Translatable\TranslatableServiceProvider" --tag=config`. Next change `source` to `database` in `config/multilingual.php`. Next change `database.model` to `Marshmallow\\MultiLanguage\\Models\\Language` in `config/multilingual.php`. Next change `fallback_locale` to `nl` in `config/translatable.php`.

Prepare your models
-------------------

[](#prepare-your-models)

First make sure you are able to create translations by updating your Nova resource.

```
public function fields(Request $request)
{
	return [
		// ...
		Multilingual::make('Language'),
	]
}
```

Next update your model so we know which columns are translatable.

```
use Marshmallow\MultiLanguage\Traits\TranslatableRoute;
use Spatie\Translatable\HasTranslations;

class Page extends Model
{
    use HasTranslations, TranslatableRoute;
    public $translatable = ['name', 'slug', 'layout'];
}
```

Config
------

[](#config)

In `config.pages` you should change `use_multi_languages` to `true`;

Usage
-----

[](#usage)

The route below will be implemented by default. You can use this route to change the current selected language.

```
Route::get('locale/{locale}', function ($locale){
    Session::put('locale', $locale);
    return redirect()->back();
});
```

TranslatableRoute trait
-----------------------

[](#translatableroute-trait)

This trait will provide two methods.

```
public function route ()
{
	return '/' . App::getLocale() . $this->routePrefix() . $this->slug;
}

protected function routePrefix ()
{
	return '';
}
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~42 days

Total

4

Last Release

2121d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/be33d2624e24c516e73892b0929447cc762f3622c024ab8d0d2a59042e5d2c7f?d=identicon)[marshmallow](/maintainers/marshmallow)

---

Top Contributors

[![stefvanesch](https://avatars.githubusercontent.com/u/46725619?v=4)](https://github.com/stefvanesch "stefvanesch (12 commits)")

---

Tags

marshmallow

### Embed Badge

![Health badge](/badges/marshmallow-multi-language/health.svg)

```
[![Health](https://phpackages.com/badges/marshmallow-multi-language/health.svg)](https://phpackages.com/packages/marshmallow-multi-language)
```

###  Alternatives

[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1927.0k1](/packages/smmoosavi-php-gettext)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
