PHPackages                             inweb/metadata - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. inweb/metadata

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

inweb/metadata
==============

Metadata for entities

9.0.0(4y ago)0324↓46.7%MITPHPPHP ^7.1|^8.0

Since Dec 13Pushed 3y ago1 watchersCompare

[ Source](https://github.com/inwebcomp/metadata)[ Packagist](https://packagist.org/packages/inweb/metadata)[ Docs](https://github.com/inwebcomp/metadata)[ RSS](/packages/inweb-metadata/feed)WikiDiscussions main Synced today

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

Parse your files and pull translatable phrases.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.1

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

[](#installation)

You can install the package via composer:

```
composer require inwebcomp/translations-parser
```

Give access to you ./lang folder

```
chmod 0777 -R ./resources/lang
```

Add facade to your *config/app.php* file

```
'aliases' => [
    // ...
    'TranslationsParser' => InWeb\TranslationsParser\TranslationsParserFacade::class
],
```

### Configuration

[](#configuration)

Run to publish **translations-parser.php** configuration file

```
php artisan vendor:publish --provider="InWeb\TranslationsParser\TranslationsParserServiceProvider"
```

There you can change locales and folders that are used by artisan command

```
// Locales to save phrases
'locales' => [
    'ru',
    'en'
],

// Directories in which phrases are searched
'directories' => [
    base_path('app'),
    resource_path('views'),
    resource_path('js')
],

// Excluded directories or files
'excluded' => [
    base_path('app/Nova')
],

// Where is your folder with translations
'lang_files_directory' => resource_path('lang')
```

Sometimes you receive your locales list during the application run. You can just overwrite this setting in your code:

```
\Config::set('translations-parser.locales', [
    'en',
    'fr
]);
```

Usage
-----

[](#usage)

### Artisan commands

[](#artisan-commands)

Parse translations with artisan command

```
php artisan translations:parse
```

Force parse translations. **Old translations will be removed**

```
php artisan translations:parse --force
```

### Methods

[](#methods)

Get phrases from string

```
TranslationsParser::parse('@lang("Phrase")');
// ['Phrase']
```

Get phrases from files in directories

```
TranslationsParser::parse([
    resouce_path('views'),
    resouce_path('js')
]);
// ['Phrase 1', 'Phrase 2', ...]
```

Can exclude directories or files from list

```
TranslationsParser::parse([
    resouce_path('views')
], [
    resouce_path('views/layouts') // Exclude 'views/layouts' directory
]);
```

Get phrases in *{locale}.json* file

```
TranslationsParser::getParsed('en');
```

Save phrases to .json file

```
TranslationsParser::save('en', [
    'Phrase'
]);

// Or with values
TranslationsParser::save('en', [
    'Phrase' => 'Value'
]);
```

By default, phrases would **not be overwritten**It will be overwritten only if there is no phrase in your .json file, or phrase translation is empty

Set last parameter to true to force writing in .json. **You will lose old data**

```
TranslationsParser::save('en', [
    'Phrase' => 'Value'
], true);
```

Save one phrase translation

```
TranslationsParser::translate('en', 'Phrase', 'Translation');
```

### Testing

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Alexander Topalo](https://github.com/Escral)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

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

Every ~0 days

Total

2

Last Release

1663d ago

Major Versions

8.0.0 → 9.0.02021-12-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19815216?v=4)[Alexander Topalo](/maintainers/Escral)[@escral](https://github.com/escral)

---

Tags

laravelmetadatainweb

### Embed Badge

![Health badge](/badges/inweb-metadata/health.svg)

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

###  Alternatives

[honeystone/laravel-seo

SEO metadata and JSON-LD package for Laravel.

35590.0k](/packages/honeystone-laravel-seo)[stephenjude/filament-blog

Filament Blog Builder

20619.4k](/packages/stephenjude-filament-blog)

PHPackages © 2026

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