PHPackages                             j-hansol/laravel-language-detect - 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. j-hansol/laravel-language-detect

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

j-hansol/laravel-language-detect
================================

This is a package for language detection and configuration for Laravel.

v1.0.0(1y ago)013MITPHPPHP ^8.2

Since Jun 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/j-hansol/laravel-language-detect)[ Packagist](https://packagist.org/packages/j-hansol/laravel-language-detect)[ RSS](/packages/j-hansol-laravel-language-detect/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Language detection and Setting for Laravel
==========================================

[](#language-detection-and-setting-for-laravel)

[![License](https://camo.githubusercontent.com/c0f6e0f7d4fb5e8918e03ae3ac07e8854ad08a8924a4d3a83aeb7554251b8c98/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f56657273696f6e2d312e302e302d626c7565)](https://opensource.org/licenses/MIT)[![License](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)](https://opensource.org/licenses/MIT)

It provides a very simple function for detecting and setting the language in a website or backend service running on the Laravel framework.

installation
------------

[](#installation)

You can simply install it with the command below from the project path under development.

```
composer require j-hansol/laravel-language-detect
```

Add the following content to the `.env` file. If not added, it will be set to the contents of the `language_detect.php` file included in the package.

```
APP_LOCALES="ko,en"
APP_LOCALE_SEGMENT=1
APP_LOCALE_FIELD_NAME=language
```

How to use
----------

[](#how-to-use)

To detect and set the language, simply add middleware to the routing path as shown below.

```
Route::prefix('{locale}')->group(function() {
    Route::get('test', [\App\Http\Controllers\LanguageSettingTest::class, 'showResult'])
        ->middleware('set_language');
});
```

Customize your preferences file
-------------------------------

[](#customize-your-preferences-file)

If you have made the necessary settings in `.env`, this step will not be necessary. Nevertheless, if you want to change the settings, you can change the contents after executing the command below.

```
php artisan vendor:publish --tag=language-detect
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

707d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ff3c001fa99179440c42f35149e0cb1da225da6cd1cec2ecbd5f2c37f76ff9ed?d=identicon)[j-hansol](/maintainers/j-hansol)

### Embed Badge

![Health badge](/badges/j-hansol-laravel-language-detect/health.svg)

```
[![Health](https://phpackages.com/badges/j-hansol-laravel-language-detect/health.svg)](https://phpackages.com/packages/j-hansol-laravel-language-detect)
```

###  Alternatives

[mcamara/laravel-localization

Easy localization for Laravel

3.5k9.1M112](/packages/mcamara-laravel-localization)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.3k](/packages/typicms-base)[vemcogroup/laravel-translation

Translation package for Laravel to scan for localisations and up/download to poeditor

135304.0k2](/packages/vemcogroup-laravel-translation)

PHPackages © 2026

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