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

ActiveLibrary

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

Save array-return configuration files in Laravel 4.

v0.9(12y ago)2168MITPHPPHP &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 today

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 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

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

4411d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/446b080afde965e973a088ba222e58e1316631d6920b70f7be05d2155ee361f3?d=identicon)[andrewsuzuki](/maintainers/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

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)

PHPackages © 2026

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