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 2w 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 40% 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

3503d 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

[smarty-gettext/smarty-gettext

Gettext plugin enabling internationalization in Smarty Package files

752.5M8](/packages/smarty-gettext-smarty-gettext)[renatomarinho/laravel-multi-language

Laravel Multi Language

235.1k](/packages/renatomarinho-laravel-multi-language)

PHPackages © 2026

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