PHPackages                             mrmmg/laravel\_variables - 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. mrmmg/laravel\_variables

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

mrmmg/laravel\_variables
========================

Moderate your variables with easy api like Drupal

v1.1.1(3y ago)114MITPHP

Since Oct 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mrmmg/laravel_variables)[ Packagist](https://packagist.org/packages/mrmmg/laravel_variables)[ RSS](/packages/mrmmg-laravel-variables/feed)WikiDiscussions main Synced 1mo ago

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

Foreword
--------

[](#foreword)

I have worked with both Drupal and Laravel frameworks. In Drupal, we have two helper functions known as `variable_set` and `variable_get`, whose job is to manage and store the variables that we intend to have in a permanent space (database). In Laravel, such a possibility is possible through `.env` file and config files, but we do not have any specific programming interface (API) to store such data in a database. Therefore, I have developed this Laravel package based on Drupal.

Note that in this package all variables stored in a global php variable when booting service providers only with one database query!

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

[](#installation)

1. First Install the latest package version

    `compoer require mrmmg/laravel_variables`
2. Run Migrations

    `php artisan migrate`

Usage
-----

[](#usage)

### Set Variable

[](#set-variable)

With `variable_set(name, value)` helper function you can store variables in database. Example:

```
variable_set("prune_cache", true);
variable_set("dataset", [...]);
```

You can store any type of value, something like Objects, Class References and etc.

### Get Variable

[](#get-variable)

Use `variable_get(name, default = null)` helper function. Example:

```
$dataset = variable_get("dataset", []);

//$dataset will be a array if found otherwise an empty array (default value) will be returned.
```

### Delete Variable

[](#delete-variable)

If you wants to delete a variable permanently from database use `variable_del(name)` helper function. Example:

```
variable_del("dataset");
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Every ~18 days

Total

3

Last Release

1264d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c44f84a4517143cec55910409742c2d8a10e359edabfc8ad32355296c1cfd7a?d=identicon)[mrmmg](/maintainers/mrmmg)

---

Top Contributors

[![mrmmg](https://avatars.githubusercontent.com/u/30490118?v=4)](https://github.com/mrmmg "mrmmg (1 commits)")

---

Tags

laravellaravel-packageslaravel-varibalelaravel-varibalesvariableslaravel variablevariables management

### Embed Badge

![Health badge](/badges/mrmmg-laravel-variables/health.svg)

```
[![Health](https://phpackages.com/badges/mrmmg-laravel-variables/health.svg)](https://phpackages.com/packages/mrmmg-laravel-variables)
```

###  Alternatives

[imliam/laravel-env-set-command

Set a .env file variable from the command line

118352.4k10](/packages/imliam-laravel-env-set-command)[msztorc/laravel-env

Laravel env helper commands

7855.4k](/packages/msztorc-laravel-env)[cekurte/environment

A library to get the values from environment variables and process to php data types

5884.0k7](/packages/cekurte-environment)[marabesi/laration

Easy package to list all variables in a Laravel application

4738.7k](/packages/marabesi-laration)[mirazmac/dotenvwriter

A PHP library to write values to .env (DotEnv) files

19129.3k7](/packages/mirazmac-dotenvwriter)

PHPackages © 2026

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