Download the PHP package marshmallow/multi-language without Composer
On this page you can find all versions of the php package marshmallow/multi-language. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download marshmallow/multi-language
More information about marshmallow/multi-language
Files in marshmallow/multi-language
Package multi-language
Short Description Vertalen
License MIT
Homepage https://github.com/Marshmallow-Development/
Informations about the package multi-language
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
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.
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 tool to your NovaServiceProvider
so you can switch the language you are working on. This is not required but is a good helper.
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
First make sure you are able to create translations by updating your Nova resource.
Next update your model so we know which columns are translatable.
Config
In config.pages
you should change use_multi_languages
to true
;
Usage
The route below will be implemented by default. You can use this route to change the current selected language.
TranslatableRoute trait
This trait will provide two methods.
All versions of multi-language with dependencies
digitalcloud/multilingual-nova Version ^2.0
marshmallow/helpers Version ^2.0