PHPackages                             hexters/logat - 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. hexters/logat

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

hexters/logat
=============

Extract locale keys from source code in seconds.

1.0.0(1y ago)0771MITPHP

Since May 19Pushed 3w ago1 watchersCompare

[ Source](https://github.com/hexters/logat)[ Packagist](https://packagist.org/packages/hexters/logat)[ Fund](https://www.buymeacoffee.com/hexters)[ GitHub Sponsors](https://github.com/hexters)[ RSS](/packages/hexters-logat/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Logat — Laravel Language Extractor
==================================

[](#logat--laravel-language-extractor)

**Logat** is a Laravel package that helps you extract all translation keys from your application’s source code into JSON language files. It scans your Blade and PHP files for translation function calls and compiles the results automatically.

Designed to simplify your localization workflow, especially when managing multi-language projects.

---

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

[](#installation)

Install the package using:

```
composer require hexters/logat --dev
```

> This package is meant for development use only and should not be required in production environments.

---

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

[](#configuration)

If you want to customize the behavior, you can publish the config file:

```
php artisan vendor:publish --provider="Hexters\Logat\LogatServiceProvider"
```

This will publish a file to `config/logat.php` with the following default contents:

```
return [

    'default' => 'id',

    'locales' => ['en', 'ms', 'id', 'ja'],

    'sources' => [
        'resources/views',
        'app',
    ],

    'functions' => ['__', 'trans', '@lang'],

    'sorting' => true,
];
```

You can adjust the default locale, supported languages, sorting, and which folders to scan for translation keys.

---

Usage
-----

[](#usage)

To scan your application and generate/update translation files, run:

```
php artisan logat:collect
```

This command will:

- Search for all translation keys in the specified source directories
- Merge with any existing translation files
- Save the output in the `lang` directory as individual JSON files for each language
- Running this command again will append any newly discovered keys to the existing JSON files

To remove unused keys that no longer exist in your source code, run:

```
php artisan logat:clean
```

This command will:

- Scan your application for active translation keys
- Remove missing keys from each language file
- Keep your JSON files clean and relevant

---

Output
------

[](#output)

After running the command, you’ll get files like:

```
lang/
├── en.json
├── id.json
├── ja.json
└── ms.json

```

Each file will contain the translation keys found in your app. Any untranslated key will have an empty string as its value.

Example:

```
{
    "Dashboard": "Dashboard",
    "User Account": "User Account"
}
```

You can use AI to change the value of the result generator

---

License
-------

[](#license)

This package is licensed under the [MIT License](LICENSE).

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance74

Regular maintenance activity

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 81.3% 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

Unknown

Total

1

Last Release

410d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d97e7edbbe58dd16d6f776aec2dacf66c5aeb730b9a4aa3de34ca0c1ebbfb9e?d=identicon)[hexters](/maintainers/hexters)

---

Top Contributors

[![hexters](https://avatars.githubusercontent.com/u/7827420?v=4)](https://github.com/hexters "hexters (13 commits)")[![wtfz](https://avatars.githubusercontent.com/u/9669062?v=4)](https://github.com/wtfz "wtfz (3 commits)")

---

Tags

i18njson-translationslanguagelanguage-extractorlaravellaravel-i18nlaravel-translationlocalizationlogattranslationtranslation-keyslaravellocalizationi18nlanguagetranslationlaravel-i18nlaravel-translationlanguage extractortranslation keysjson translationslogat

### Embed Badge

![Health badge](/badges/hexters-logat/health.svg)

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

###  Alternatives

[codezero/laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

544664.5k4](/packages/codezero-laravel-localized-routes)[longman/laravel-multilang

Package to integrate multi language (multi locale) functionality in Laravel 5.x

5414.6k1](/packages/longman-laravel-multilang)[smousss/laravel-globalize

Make Laravel projects translatable in a matter of seconds!

2169.2k](/packages/smousss-laravel-globalize)[jrmajor/fluent

Fluent localization system for PHP

2918.2k7](/packages/jrmajor-fluent)

PHPackages © 2026

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