PHPackages                             calen/persist - 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. calen/persist

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

calen/persist
=============

Application Preferences

1.0.0(9y ago)020MITPHP

Since Oct 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/MrCalen/Persist)[ Packagist](https://packagist.org/packages/calen/persist)[ RSS](/packages/calen-persist/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Persist
=======

[](#persist)

Persist is a library intended to manage application settings. The settings persists every request and handle multiple drivers (currently file and database).

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

[](#installation)

Add the repository as a dependency by running:

`composer require calen/persist`

Then add the provider to the provider list in `app.php`:

```
....
App\Providers\RouteServiceProvider::class,

Calen\Persist\PersistServiceProvider::class,

```

You can then publish the packages configuration file by running

`php artisan vendor:publish`

which will create the file `persist.php` in the `config` directory.

The configuration is pretty simple:

- the driver to use (database or file)
- the file path in case of file driver
- the table name in case of database driver

The publish will also create a migration file if you need to use the database driver.

Usage
-----

[](#usage)

The settings are stored as a JSON object in either the file or the database.

*Persist* comes with a Facade. You can add this facade to the facades list in `app.php`:

```
'Persist' => Calen\Persist\Facade\Persist::class,

```

To publish a key: `Persist::persist('name.subname.subsubname', 'value', true);`.

The first parameter is the key to add. As the storage is JSON, the subname and subsubname are the nest in the JSON object. If the names and subnames do not exist, they will be created. The second parameter is the value to set to the key. The third parameter is optional and specifies if the save should be applied. default is false

To get a key, use: `Persist::get('name.subname.subsubname');`

with the path in the object. If the path is not a leaf in the tree, it will return the tree corresponding as an array.

To forget a key, use: `Persist:forget('name.subname.subsubname', true);`

which will simple remove the key.

Packagist
---------

[](#packagist)

My packagist repo is available here :

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

3503d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd10e641b4f73aca1b3dfdb957c8c186dd942460a1d3685c4e9c95cc18a93b5c?d=identicon)[Calen](/maintainers/Calen)

### Embed Badge

![Health badge](/badges/calen-persist/health.svg)

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

###  Alternatives

[strictus/strictus

Strict Typing for local variables in PHP

1606.9k](/packages/strictus-strictus)[wodby/wordpress-composer

Project template for WordPress projects with composer

691.1k](/packages/wodby-wordpress-composer)

PHPackages © 2026

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