PHPackages                             bastienbot/laravel-set-lang - 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. bastienbot/laravel-set-lang

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

bastienbot/laravel-set-lang
===========================

Package to detect and set languages easily for Laravel

0.5(9y ago)0391PHP

Since Jan 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/bastienbot/laravel-set-lang)[ Packagist](https://packagist.org/packages/bastienbot/laravel-set-lang)[ RSS](/packages/bastienbot-laravel-set-lang/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

Laravel set Lang
================

[](#laravel-set-lang)

Infos
=====

[](#infos)

This package is only compatible with Laravel 5.1+ This package has two purposes :

- Setting by **default** the language to the client browser language. Fallback language is english
- Providing routes and a service provider to set the user's language choice in a **cookie** and retrieve it on load

Usage
=====

[](#usage)

- Go to you Laravel project folder in your favorite terminal
- Execute : `composer require bastienbot/laravel-set-lang dev-master`
- Add the following line to the `config/app.php` :

```
'providers' => [
        Illuminate\Auth\AuthServiceProvider::class,
        Illuminate\Broadcasting\BroadcastServiceProvider::class,
        Illuminate\Bus\BusServiceProvider::class,
        ...
        ...
        ...
        Bastienbot\LaravelSetLang\LangServiceProvider::class,

```

- Now you just need to create the links in HTML in your view(s), the anchors being : `/lang/{lang}`. `{lang}` should be a string, ex : `en`, `fr`, etc...

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

3458d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6647932?v=4)[Bastien Botella](/maintainers/bastienbot)[@bastienbot](https://github.com/bastienbot)

---

Top Contributors

[![bastienbot](https://avatars.githubusercontent.com/u/6647932?v=4)](https://github.com/bastienbot "bastienbot (1 commits)")

---

Tags

i18nlanguagelaravel

### Embed Badge

![Health badge](/badges/bastienbot-laravel-set-lang/health.svg)

```
[![Health](https://phpackages.com/badges/bastienbot-laravel-set-lang/health.svg)](https://phpackages.com/packages/bastienbot-laravel-set-lang)
```

###  Alternatives

[php-translation/translator

Translator services

25224.8k5](/packages/php-translation-translator)[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1926.6k1](/packages/smmoosavi-php-gettext)[laradevs/spanish

labels translated to spanish

166.7k](/packages/laradevs-spanish)

PHPackages © 2026

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