PHPackages                             angelo8828/laravel-js-localization - 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. angelo8828/laravel-js-localization

ActiveLibrary[Localization &amp; i18n](/categories/localization)

angelo8828/laravel-js-localization
==================================

Laravel package to provide localizations to the Javascript code. Future-proofed and modernized version of https://github.com/andywer/laravel-js-localization

14.4kPHP

Since Jan 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Angelo8828/laravel-js-localization)[ Packagist](https://packagist.org/packages/angelo8828/laravel-js-localization)[ RSS](/packages/angelo8828-laravel-js-localization/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-js-localization
=======================

[](#laravel-js-localization)

Simple, ease-to-use and flexible package for the [Laravel](https://laravel.com/) web framework. Allows you to use localized messages of the Laravel webapp (see `resources/lang` directory) in your Javascript code. You may easily configure which messages you need to export. Future-proofed and modernized version of

This version was directly forked from [Andywer's JS Localization Helper for Laravel](https://github.com/andywer/laravel-js-localization). The original project is no longer maintained and not working anymore for Laravel projects having versions 9.0.

Please see this [comparison tool](https://github.com/andywer/laravel-js-localization/compare/laravel-8...Angelo8828:laravel-js-localization:main) to check the changes I made. Please see original repository to see how it works. I will not change nor add to any of the functionalities of the original source code

Branches
--------

[](#branches)

LaravelBranch10dev-laravel-10Installation
------------

[](#installation)

Add the following line to the `require` section of your Laravel webapp's `composer.json` file:

```
    "require": {
        "angelo8828/laravel-js-localization": "dev-laravel-10"      // see table above
    }
```

Run `composer update` to install the package.

Finally add the following line to the `providers` array of your `app/config/app.php` file:

```
    'providers' => [
        /* ... */
        JsLocalization\JsLocalizationServiceProvider::class
    ]
```

Configuration
-------------

[](#configuration)

Run `php artisan vendor:publish` first. This command copies the package's default configuration to `config/js-localization.php`.

You may now edit this file to define the messages you need in your Javascript code. Just edit the `messages` array in the config file.

Example (exports all reminder messages):

```
