PHPackages                             pwweb/localisation - 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. pwweb/localisation

Abandoned → [pwweb/laravel-core](/?search=pwweb%2Flaravel-core)ArchivedLibrary[Localization &amp; i18n](/categories/localization)

pwweb/localisation
==================

Localisation package for Laravel

0.2.7-beta(5y ago)1447MITPHPPHP &gt;=7.3.7

Since Feb 22Pushed 5y agoCompare

[ Source](https://github.com/pwweb/localisation)[ Packagist](https://packagist.org/packages/pwweb/localisation)[ Docs](https://github.com/pwweb/localisation)[ RSS](/packages/pwweb-localisation/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (10)Dependencies (7)Versions (17)Used By (0)

Laravel Localisation Package
============================

[](#laravel-localisation-package)

[![Version](https://camo.githubusercontent.com/885fdaaf3fb19e6d0b3d814385d6b812b750e39e41821eebbfdaebcf25eeac9d/68747470733a2f2f706f7365722e707567782e6f72672f70777765622f6c6f63616c69736174696f6e2f762f737461626c652e737667)](https://github.com/pwweb/localisation/releases)[![Downloads](https://camo.githubusercontent.com/10857ba08db0c608ed27480587eb49566024c92b4f7aa5ad2814915142397b36/68747470733a2f2f706f7365722e707567782e6f72672f70777765622f6c6f63616c69736174696f6e2f642f746f74616c2e737667)](https://github.com/pwweb/localisation)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6ea21349869f4c94f2bf44a4109aa8b63799b914bda775ac306a79995e9969ff/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70777765622f6c6f63616c69736174696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/pwweb/localisation/?branch=master)[![StyleCI](https://camo.githubusercontent.com/3bdc6997291af69f207da1e385231fd0a22d21ddd2a1b9845fbfef651333beec/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f373534383938362f736869656c643f7374796c653d666c6174)](https://github.styleci.io/repos/242411012)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

**Localisation**: C3P0 for Laravel. Take a look at [contributing.md](contributing.md) to see a to do list.

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

[](#installation)

Via Composer run the following:

```
# Install the package.
$ composer require pwweb/localisation

# Publish config, migration, languages and controllers.
# Note: Individual publishing tags are available, see chapter Customizing.
$ php artisan vendor:publish --provider="PWWEB\Localisation\LocalisationServiceProvider"

# Run migrations
$ php artisan migrate
```

Pre-requisites
--------------

[](#pre-requisites)

The package assumes a standard Laravel installation if the bundled default contollers for the entities are to be used. The bundled controllers extend from `App\Http\Controllers\Controller`. If other, custom base controllers are used as part of the installation, refer to [Customizing](Customizing).

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

[](#configuration)

### Customizing

[](#customizing)

The package provides the following tags for publishing individual components for customizing:

TagDescription`pwweb.localisation.config`Publish the configuration files to e.g. adjust database table names.`pwweb.localisation.migrations`Publish the migration file(s) to make alterations to the database tables.`pwweb.localisation.language`Publish the language files to make adjustments to the translation strings.`pwweb.localisation.views`Publish the view files to make adjustments to the overall structure of the views.### Default and Fallback Language

[](#default-and-fallback-language)

It is recommended to change your `app.php` to use both the [ISO-639-1 ISO Language Code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) as well as the [ISO-3166 ISO Country Code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). This can be achieved by changing the following two variables:

```
