PHPackages                             orbtall/laravel-intl - 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. orbtall/laravel-intl

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

orbtall/laravel-intl
====================

Easy localization for Laravel

1.0(2y ago)02MITPHPPHP &gt;=7.1.0

Since Nov 15Pushed 2y agoCompare

[ Source](https://github.com/orbtall/laravel-intl)[ Packagist](https://packagist.org/packages/orbtall/laravel-intl)[ Docs](https://github.com/orbtall/laravel-intl)[ RSS](/packages/orbtall-laravel-intl/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Localization
====================

[](#laravel-localization)

Easy i18n localization for Laravel, an useful tool to combine with Laravel localization classes.

The package offers the following:

- Detect language from browser
- Smart redirects (Save locale in session/cookie)
- Smart routing (Define your routes only once, no matter how many languages you use)
- Translatable Routes
- Supports caching &amp; testing
- Option to hide default locale in url
- Many snippets and helpers (like language selector)

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
- [Redirect Middleware](#redirect-middleware)
- [Helpers](#helpers)
- [Translated Routes](#translated-routes)
- [Caching routes](#caching-routes)
- [Testing](#testing)
- [Common Issues](#common-issues)
    - [POST is not working](#post-is-not-working)
    - [MethodNotAllowedHttpException](#methodnotallowedhttpexception)
    - [Validation message is always in default locale](#validation-message-is-only-in-default-locale)
- [Collaborators](#collaborators)
- [Changelog](#changelog)
- [License](#license)

Laravel compatibility
---------------------

[](#laravel-compatibility)

Laravellaravel-localization4.0.x0.13.x4.1.x0.13.x4.2.x0.15.x5.0.x/5.1.x1.0.x5.2.x-5.4.x (PHP 7 not required)1.2.x5.2.x-5.8.x (PHP 7 required)1.3.x5.2.0-6.x (PHP 7 required)1.4.x5.2.0-9.x (PHP 7 required)1.7.xInstallation
------------

[](#installation)

Install the package via composer: `composer require orbtall/laravel-localization`

For Laravel 5.4 and below it necessary to [register the service provider](/ADDITIONS.md#for-laravel-5.4-and-below).

### Config Files

[](#config-files)

In order to edit the default configuration you may execute:

```
php artisan vendor:publish --provider="Orbtall\LaravelLocalization\LaravelLocalizationServiceProvider"

```

After that, `config/localization.php` will be created.

The configuration options are:

- **supportedLocales** Languages of your app (Default: English &amp; Spanish).
- **useAcceptLanguageHeader** If true, then automatically detect language from browser.
- **hideDefaultLocaleInURL** If true, then do not show default locale in url.
- **localesOrder** Sort languages in custom order.
- **localesMapping** Rename url locales.
- **utf8suffix** Allow changing utf8suffix for CentOS etc.
- **urlsIgnored** Ignore specific urls.

### Register Middleware

[](#register-middleware)

You may register the package middleware in the `app/Http/Kernel.php` file:

```
