PHPackages                             makth/laravel-db-language - 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. [Database &amp; ORM](/categories/database)
4. /
5. makth/laravel-db-language

ActiveLibrary[Database &amp; ORM](/categories/database)

makth/laravel-db-language
=========================

Laravel command to add language fields on database

2.0(8y ago)037MITPHPPHP &gt;=5.5

Since Oct 5Pushed 8y ago1 watchersCompare

[ Source](https://github.com/MakisThomas/laravel-db-language)[ Packagist](https://packagist.org/packages/makth/laravel-db-language)[ RSS](/packages/makth-laravel-db-language/feed)WikiDiscussions master Synced today

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

Laravel DB Language
===================

[](#laravel-db-language)

This package gives you an easy way to generate automatically all language fields on database, using Laravel 5 command. If you have on database fields like `body_en` and you want to create new like `body_it` you can use this package to create it.

Installing
----------

[](#installing)

First, pull in the package through Composer.

```
composer require makth/laravel-db-language

```

or

```
"require":{
    "makth/laravel-db-language": "2.0"
}
```

Next, open `config/app.php`, and include service provider.

```
'providers' => [
    Makth\DbLanguage\DbLanguageServiceProvider::class,
];
```

And, for convenience, add a facade alias to the same file at the bottom:

```
'aliases' => [
    'Lang' => Makth\DbLanguage\Facade\Lang::class,
];
```

Usage
-----

[](#usage)

### Add a language

[](#add-a-language)

```
php artisan language:add German

```

### Remove a language

[](#remove-a-language)

```
php artisan language:remove German

```

#### Default language

[](#default-language)

You can set your default language using option `--default`. For example:

```
php artisan language:add German --default="English"

```

If you want to have more than one languages, you set your main (already installed) language as default, and you add the other languages.

### Config

[](#config)

You can publish config file `lang.php`, and set your default language there.

```
php artisan vendor:publish --tag=config

```

### Language Field

[](#language-field)

You can have form fields with multiple languages.

#### Step 1

[](#step-1)

Export css files to public folder.

```
php artisan vendor:publish --tag=flags

```

#### Step 2

[](#step-2)

Add in your blade file, on head tag:

```
@include('lang::style')

```

And at the bottom of the body:

```
@include('lang::script')

```

And now you can get the form field with all installed languages like this:

```
{{ Lang::fields(
    'table_name',
    'field_name',
    ['first_language_value', 'second_language_value'],
    null,
    ['placeholder' => 'Name', 'required' => 'required']
    )
}}
```

- `table_name` : the name of the db table.
- `field_name` : the name of table field, without language extension.
- the third parameter is an array with languages values.
- the fourth parameter used to sets manual the default language.
- the fifth parameter is an array with extra attributes for the fields.

For form fields used twitter bootstrap, and for the flags [this](https://github.com/lipis/flag-icon-css) package.

Authors
-------

[](#authors)

- **Makis Thomas**

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/148db7c4f7065df4dcbdd5e448250b4e4e074adb91f309965769204ba7e71be0?d=identicon)[MakisThomas](/maintainers/MakisThomas)

---

Top Contributors

[![makthomas](https://avatars.githubusercontent.com/u/3438467?v=4)](https://github.com/makthomas "makthomas (35 commits)")

---

Tags

laravellanguagedatabase language

### Embed Badge

![Health badge](/badges/makth-laravel-db-language/health.svg)

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

###  Alternatives

[codezero/laravel-unique-translation

Check if a translated value in a JSON column is unique in the database.

186965.1k7](/packages/codezero-laravel-unique-translation)[io238/laravel-iso-countries

Ready-to-use Laravel models and relations for country (ISO 3166), language (ISO 639-1), and currency (ISO 4217) information with multi-language support.

5462.3k](/packages/io238-laravel-iso-countries)[tomatophp/filament-translations

Manage your translation with DB and cache, you can scan your languages tags like trans(), \_\_(), and get the string inside and translate them use UI.

6230.1k3](/packages/tomatophp-filament-translations)[giacomomasseron/laravel-models-generator

Generate Laravel models from an existing database

484.2k](/packages/giacomomasseron-laravel-models-generator)

PHPackages © 2026

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