PHPackages                             premise/laralang - 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. premise/laralang

ActiveLibrary

premise/laralang
================

3.0(9y ago)013MITPHP

Since Sep 28Pushed 9y ago1 watchersCompare

[ Source](https://github.com/RichJones22/laralang)[ Packagist](https://packagist.org/packages/premise/laralang)[ RSS](/packages/premise-laralang/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (23)Used By (0)

Laralang
========

[](#laralang)

[![StyleCI](https://camo.githubusercontent.com/1b47c12c83d69fd6f7491cbc9e8fac29e7500e4bba01063064346eeba2b9ec6d/68747470733a2f2f7374796c6563692e696f2f7265706f732f36393436303831352f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/69460815)[![Scrutinizer](https://camo.githubusercontent.com/bb7aed7a59b6f5f82e94e9095dd76dcae948e3a7855295113014b136d5883638/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f32346169746f722f6c6172616c616e672e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/24aitor/laralang/?branch=master)[![GitHub license](https://camo.githubusercontent.com/fabd250b8c8ba1fa0a8db695ef3fde18ee3d239e495c0fd92353c3026967f048/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f32346169746f722f6c6172616c616e672e7376673f7374796c653d666c61742d737175617265)](https://raw.githubusercontent.com/24aitor/laralang/master/LICENSE)

[![](https://camo.githubusercontent.com/8f8ba943db79231aeb5b2de7dafc6a36c3676b62ef2baacb1e6c4617e40dce04/687474703a2f2f692e696d6775722e636f6d2f31315476636f682e706e67)](https://camo.githubusercontent.com/8f8ba943db79231aeb5b2de7dafc6a36c3676b62ef2baacb1e6c4617e40dce04/687474703a2f2f692e696d6775722e636f6d2f31315476636f682e706e67)

Getting Started
---------------

[](#getting-started)

### Step 1. Install it with composer

[](#step-1-install-it-with-composer)

Running the command below:

```
composer require Premise/laralang

```

### Step 2. Register service provider &amp; aliases

[](#step-2-register-service-provider--aliases)

Include the line below to config/app.php inside array `'providers' => [` :

```
Premise\Laralang\LaralangServiceProvider::class,

```

Include the line below to config/app.php inside array `'aliases' => [` :

```
'Laralang'   => Premise\Laralang\Facades\Laralang::class,

```

### Step 3. Publish vendor

[](#step-3-publish-vendor)

It will publish assets and config file.

Running the command below:

```
php artisan vendor:publish

```

### Step 4. Migrate

[](#step-4-migrate)

Running the command below:

```
php artisan migrate

```

### Step 5. Configure default values

[](#step-5-configure-default-values)

**STRONGLY IMPORTANT:** Change the password of config *(Default password: laralangAdmin )*

Apart from the password, the rest of default values can be modified also on `config/laralang.php`. Furthermore you can modify it in a specific translation with the functions below.

Using laralang
--------------

[](#using-laralang)

### Functions

[](#functions)

**setFrom()**

It sets the language of the string to translate in a specific translation.

*Default: en*

**SetTo()**

It sets the language that you'll output in a specific translation.

*Default: app\_locale*

**SetTranslator()**

This option let you to change the default translator in a specific translation.

*Default: mymemory*

*Currently there are two available translators: apertium, mymemory. But we strongly recommend to use mymemory.*

**setDebug()**

Debug option let you to know the reason of an unexpected result with colorful messages in a specific translation.

*Default: false*

---

### Examples of use

[](#examples-of-use)

Then few examples of tranlsation:

```
{!! Laralang::trans('Hello world!') !!}

{!! Laralang::trans('Hello world!')->setDebug(true) !!}

{!! Laralang::trans('Hello world!')->setTo('es') !!}

{!! Laralang::trans('Hello world!')->setTo('ca') !!}

{!! Laralang::trans('Hello world!')->setTo('ca')->setDebug(true) !!}

{!! Laralang::trans('Hallo welt!')->setFrom('de')->setTo('fr') !!}

{!! Laralang::trans('Hello world!')->setTo('pt') !!}

{!! Laralang::trans('Hello world!')->setTo('de') !!}

{!! Laralang::trans('Hello world!')->setTo('ml') !!}

{!! Laralang::trans('Hello world!')->setTo('zh') !!}
```

Then the result:

[![Result of example](https://camo.githubusercontent.com/9ad6c1d5759807a32d8b4f0b819cf16ceb57909eb2a5eeb0fcdaca7672def361/687474703a2f2f692e696d6775722e636f6d2f4c4b4f6a5a64422e706e67)](https://camo.githubusercontent.com/9ad6c1d5759807a32d8b4f0b819cf16ceb57909eb2a5eeb0fcdaca7672def361/687474703a2f2f692e696d6775722e636f6d2f4c4b4f6a5a64422e706e67)

### Admin panel

[](#admin-panel)

Furthermore now you can control which translations are saved on your DB and then you can manage it *(edit and delete)*.

#### First you should be logged into loaralang.

[](#first-you-should-be-logged-into-loaralang)

*Route prefix can be changed on your config file, but by default it's laralang*

- How to acces to panel?

You should visit next url:

or in localhost you should visit

Then you should see the laralang login page (photo below)

[![Laralang login page](https://camo.githubusercontent.com/a556473faf930e073c1fd821b59c4484f0dede9fdad059bbaabf6ab01d32e3b0/687474703a2f2f692e696d6775722e636f6d2f3344674f7333432e706e67)](https://camo.githubusercontent.com/a556473faf930e073c1fd821b59c4484f0dede9fdad059bbaabf6ab01d32e3b0/687474703a2f2f692e696d6775722e636f6d2f3344674f7333432e706e67)

Now you must enter the password you set on [Step 5](#step-5) and then click login to manage your translations!

[![View of translations](https://camo.githubusercontent.com/8177f9a21739fd7c53018ff0d6cb957f17427bd57605e5d2c8c9bb660f35fa8f/687474703a2f2f692e696d6775722e636f6d2f3865557a65746c2e706e67)](https://camo.githubusercontent.com/8177f9a21739fd7c53018ff0d6cb957f17427bd57605e5d2c8c9bb660f35fa8f/687474703a2f2f692e696d6775722e636f6d2f3865557a65746c2e706e67)

[![Editing translation #3](https://camo.githubusercontent.com/ce9efdbb2bafafa74bccb605c74a6a6ddbb0eaf43b275f1be19e228aefc15f13/687474703a2f2f692e696d6775722e636f6d2f663370637761622e706e67)](https://camo.githubusercontent.com/ce9efdbb2bafafa74bccb605c74a6a6ddbb0eaf43b275f1be19e228aefc15f13/687474703a2f2f692e696d6775722e636f6d2f663370637761622e706e67)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 91.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

14

Last Release

3461d ago

Major Versions

1.2.2 → 2.02016-10-30

2.3 → 3.02016-11-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a4a636d56a051785fcc864d6669af92e42fc7527c5190df6a8d6458bfc375f0?d=identicon)[RichJones22](/maintainers/RichJones22)

---

Top Contributors

[![24aitor](https://avatars.githubusercontent.com/u/20477883?v=4)](https://github.com/24aitor "24aitor (97 commits)")[![RichJones22](https://avatars.githubusercontent.com/u/12885459?v=4)](https://github.com/RichJones22 "RichJones22 (5 commits)")[![ConsoleTVs](https://avatars.githubusercontent.com/u/6124435?v=4)](https://github.com/ConsoleTVs "ConsoleTVs (4 commits)")

### Embed Badge

![Health badge](/badges/premise-laralang/health.svg)

```
[![Health](https://phpackages.com/badges/premise-laralang/health.svg)](https://phpackages.com/packages/premise-laralang)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
