PHPackages                             mohsentm/laravel-db-enum - 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. mohsentm/laravel-db-enum

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

mohsentm/laravel-db-enum
========================

laravel-db-enum is a trait for laravel models. use this trait on modules for getting the table fileds enum values

v1.0.0(7y ago)13.1k1[2 PRs](https://github.com/mohsentm/laravel-db-enum/pulls)Apache-2.0PHP

Since Dec 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mohsentm/laravel-db-enum)[ Packagist](https://packagist.org/packages/mohsentm/laravel-db-enum)[ RSS](/packages/mohsentm-laravel-db-enum/feed)WikiDiscussions master Synced 2mo ago

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

Get Enum values from database For Laravel
=========================================

[](#get-enum-values-from-database-for-laravel)

laravel-db-enum is a trait for laravel models. use this trait on modules for getting the table fileds enum values.

tags: laravel, lumen, eloquent, enum field

### Installing

[](#installing)

Pull this package via Composer.

```
    {
        "require": {
            "mohsentm/laravel-db-enum": "^1.*"
        }
    }

```

or run in terminal: `composer require mohsentm/laravel-db-enum`

Usage
-----

[](#usage)

use this trait `use Mohsentm\EnumValue;` your the model.

```
namespace App;

use Illuminate\Database\Eloquent\Model;
use Mohsentm\EnumValue;

class TestModal extends Model
{
	protected $table = "test";
    //Get enum value trait
  	use EnumValue;
}
```

then use **`getEnumValues()`** function to get enum values

```
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\TestModal;

class TestController extends Controller
{
	public function index(){
    	//return the array of table enum value list
		return TestModal::getEnumValues();
	}
}
```

result

```
{"user_status":["enable","disable"]}
```

Cache
-----

[](#cache)

To have best performance this package cache the result.

Contribute
----------

[](#contribute)

Would you like to help with this project? Great! You don't have to be a developer, either. If you've found a bug or have an idea for an improvement, please open an [issue](https://github.com/mohsentm/laravel-db-enumr/issues) and tell us about it.

If you *are* a developer wanting contribute an enhancement, bug fix or other patch to this project, please fork this repository and submit a pull request detailing your changes. We review all PRs! This open source project is released under the [Apache 2.0 license](https://opensource.org/licenses/Apache-2.0) which means if you would like to use this project's code in your own project you are free to do so. Speaking of, if you have used our code in a cool new project we would like to hear about it! [Please send us an email](mailto:hosseini.m1370@gmail.com).

License
-------

[](#license)

Please refer to the [LICENSE](https://opensource.org/licenses/Apache-2.0) file that came with this project.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

2716d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/72f10f2925a1520b47586b776576211a1e134be7e23136ab97f6917a3d12d643?d=identicon)[mohsentm](/maintainers/mohsentm)

---

Top Contributors

[![mohsentm](https://avatars.githubusercontent.com/u/11064974?v=4)](https://github.com/mohsentm "mohsentm (13 commits)")

---

Tags

laravelenumdatabaselumendbtable

### Embed Badge

![Health badge](/badges/mohsentm-laravel-db-enum/health.svg)

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

###  Alternatives

[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[arcanedev/laravel-settings

This package allows you to persists configs/settings for Laravel projects.

74131.4k6](/packages/arcanedev-laravel-settings)[webparking/laravel-db-rebuild

A laravel package that allows for quick database rebuilds with presets.

448.8k](/packages/webparking-laravel-db-rebuild)

PHPackages © 2026

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