PHPackages                             andrewsuzuki/perm - 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. andrewsuzuki/perm

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

andrewsuzuki/perm
=================

Save array-return configuration files in Laravel 4.

v0.9(12y ago)1168MITPHPPHP &gt;=5.3.0

Since Apr 12Pushed 12y ago1 watchersCompare

[ Source](https://github.com/andrewsuzuki/perm)[ Packagist](https://packagist.org/packages/andrewsuzuki/perm)[ RSS](/packages/andrewsuzuki-perm/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

perm
====

[](#perm)

[![Build Status](https://camo.githubusercontent.com/abcee103136becb181d451931b323c3e6a3b7c04e40ba527f1fc0dfc9a1e7e37/68747470733a2f2f7472617669732d63692e6f72672f616e6472657773757a756b692f7065726d2e737667)](https://travis-ci.org/andrewsuzuki/perm)[![Still Maintained](https://camo.githubusercontent.com/614686488ab811d082767d350c16db56dda9235ee74fb9ff659627e27dae552f/687474703a2f2f7374696c6c6d61696e7461696e65642e636f6d2f616e6472657773757a756b692f7065726d2e706e67)](http://stillmaintained.com/andrewsuzuki/perm)

perm offers a simple way to save and retrieve "native" php configuration files in the filesystem.

For example, if writing a cms like [Vessel](https://github.com/hokeo/vessel), you might want to save fast configuration values (like a site title or url) **perm**-anently from an admin interface. This is easy with perm.

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

[](#requirements)

- PHP 5.3+ or HHVM
- Laravel 4
- Composer

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

[](#installation)

perm installs with [Composer](https://getcomposer.org) through [Packagist](https://packagist.org/packages/andrewsuzuki/perm).

Add the following to your composer.json:

```
{
	"require": {
		"andrewsuzuki/perm": "dev-master",
	}
}
```

Then run `composer update`.

Now add the following to your `providers` array in config/app.php:

```
'Andrewsuzuki\Perm\PermServiceProvider',
```

Now add the facade alias to the `aliases` array:

```
'Perm' => 'Andrewsuzuki\Perm\Facades\Perm',
```

And that's it.

### Configuration

[](#configuration)

If you'd like to load/save files from a base directory other than app/config, publish the package's configuration:

```
php artisan config:publish hokeo/vessel

```

Then modify the basepath in app/config/packages/andrewsuzuki/perm/config.php.

Usage
-----

[](#usage)

- Load a config file, or mark a non-existing file/directory for creation. *chainable*

```
// dot notation from base path (see above for configuration)
$perm = Perm::load('profile.andrew');
// ...or absolute path (no extension)
$perm = Perm::load('/path/to/file');
```

> If the file's directory does not exist, **it will be created**.

- Get a config value.

```
$location   = $perm->get('location');
$location   = $perm->location; // for the first level, you can use magic properties
$first_name = $perm->get('name.first'); // use dot notation for nested values
```

- Get multiple values in one go (returns array).

```
$locationAndFirstName = $perm->get(array('location', 'name.first'));
// or...
list($location, $firstName) = $perm->get(array('location', 'name.first'));
```

- Get all config values.

```
$config = $perm->all();
```

- Set a value. *chainable*

```
$perm->set('timezone', 'UTC');
// for the first level, you can use magic properties
$perm->timezone = 'UTC';
```

- Set a value if and only if it doesn't exist. *chainable*

```
$perm->setIf('timezone', 'UTC');
```

- Set multiple values in one go. *chainable*

```
$perm->set(array('timezone' => 'UTC', 'location' => 'Earth'));
```

- Check if a key exists.

```
$exists = $perm->has('location'); // true/false
$exists = $perm->has('name.first'); // true/false
```

- Forget a key. *chainable*

```
$perm->forget('location');
```

- Reset (forget all key/values). *chainable*

```
$perm->reset();
```

- Save updated config. *chainable*

```
$perm->save();
```

- Update current loaded filename (will **not** update loaded config). Filename basename must not contain dots. *chainable*

```
$perm->setFilename('/path/to/new/file');
// then you might set some more values, then call ->save() again, etc...
```

### Method chaining

[](#method-chaining)

Chaining methods is an easy way to consolidate, and improve readability. You can combine any of the above methods marked as *chainable*. For example:

```
Perm::load('profile.andrew')->set('name', 'Andrew')->forget('location')->save();
```

Contributors
------------

[](#contributors)

- [Andrew Suzuki](http://andrewsuzuki.com)

To contribute, please fork and submit a pull request. Otherwise, feel free to submit possible enhancements/issues on the [issues](https://github.com/andrewsuzuki/perm/issues) page.

License
-------

[](#license)

Vessel is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

4462d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/947837?v=4)[Andrew Suzuki](/maintainers/andrewsuzuki)[@andrewsuzuki](https://github.com/andrewsuzuki)

---

Top Contributors

[![andrewsuzuki](https://avatars.githubusercontent.com/u/947837?v=4)](https://github.com/andrewsuzuki "andrewsuzuki (15 commits)")

### Embed Badge

![Health badge](/badges/andrewsuzuki-perm/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[illuminate/session

The Illuminate Session package.

9938.5M824](/packages/illuminate-session)[laravel/ai

The official AI SDK for Laravel.

1.0k2.1M165](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k239.9k76](/packages/moonshine-moonshine)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[flarum/core

Delightfully simple forum software.

201.4M2.2k](/packages/flarum-core)

PHPackages © 2026

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