PHPackages                             dejodev/laravel-multi-language-strings - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. dejodev/laravel-multi-language-strings

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dejodev/laravel-multi-language-strings
======================================

Laravel Package that adds a Multilanguage string class and an Attribute cast for adding language support to Models.

v1.1(2mo ago)111MITPHPPHP ^8.3 || ^8.4 || ^8.5CI passing

Since Feb 21Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/W-DEJONG/laravel-multi-language-strings)[ Packagist](https://packagist.org/packages/dejodev/laravel-multi-language-strings)[ RSS](/packages/dejodev-laravel-multi-language-strings/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (20)Versions (3)Used By (0)

Laravel Multi Language strings package
======================================

[](#laravel-multi-language-strings-package)

The Laravel Multi Language Strings package allows you to easily store and manage multilanguage strings in a JSON field within a database table. It provides a `MultiLanguageString` class and an attribute cast for Eloquent models, which are aware of Laravel locale and fallback locale settings. This package simplifies the process of setting and retrieving multilanguage strings, ensuring seamless localization support in your Laravel applications.

Installation
------------

[](#installation)

Install the package via composer:

```
  composer require dejodev/laravel-multi-language-strings
```

Add a JSON field to your database migration to store the multilanguage strings.

```
    public function up(): void
    {
        Schema::create('products', function (Blueprint $table) {
            $table->id();
            $table->json('productName'); // Add this line
            $table->timestamps();
        });
    }
```

Add the MultiLanguageString class to your model's `$casts` property.

```
