PHPackages                             koine/strong-parameters - 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. koine/strong-parameters

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

koine/strong-parameters
=======================

Rails like Strong parameters for php

0.9.3(11y ago)6687[1 issues](https://github.com/koinephp/StrongParameters/issues)1MITPHPPHP &gt;=5.3.3

Since Sep 23Pushed 9y agoCompare

[ Source](https://github.com/koinephp/StrongParameters)[ Packagist](https://packagist.org/packages/koine/strong-parameters)[ RSS](/packages/koine-strong-parameters/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (5)Used By (1)

Koine Strong Parameters
-----------------------

[](#koine-strong-parameters)

Rails-like strong parameters for php

**Work in progress**

Code information:

[![Build Status](https://camo.githubusercontent.com/79b5acff50cbfd842eba323893f55572a3aa9626c5aa25fb8a1223c873d9c59a/68747470733a2f2f7472617669732d63692e6f72672f6b6f696e657068702f5374726f6e67506172616d65746572732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/koinephp/StrongParameters)[![Coverage Status](https://camo.githubusercontent.com/46cea8979132486ed52edc1ce0c9b855547c5a80ae666e8cba790d032d078915/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6b6f696e657068702f5374726f6e67506172616d65746572732f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/koinephp/StrongParameters?branch=master)[![Code Climate](https://camo.githubusercontent.com/f4a794dccaabc482caa19794d698ea322488a1c322e011a9cea6cdae6356afad/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6b6f696e657068702f5374726f6e67506172616d65746572732e706e67)](https://codeclimate.com/github/koinephp/StrongParameters)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/dcce0ebe317ed90d8c7b5daffea017831c267820eb26e9d50da814d8f88beb28/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b6f696e657068702f5374726f6e67506172616d65746572732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/koinephp/StrongParameters/?branch=master)

Package information:

[![Latest Stable Version](https://camo.githubusercontent.com/2cc9a027c65ddeef68b0fe9bc0d5b877200cf041e16a363cc12c9ee9687930f4/68747470733a2f2f706f7365722e707567782e6f72672f6b6f696e652f7374726f6e672d706172616d65746572732f762f737461626c652e737667)](https://packagist.org/packages/koine/strong-parameters)[![Total Downloads](https://camo.githubusercontent.com/b964f9a692f79b48092f4c183a223385cb036b5aa413426b8f90291f4fd8f520/68747470733a2f2f706f7365722e707567782e6f72672f6b6f696e652f7374726f6e672d706172616d65746572732f646f776e6c6f6164732e737667)](https://packagist.org/packages/koine/strong-parameters)[![Latest Unstable Version](https://camo.githubusercontent.com/cc1a0fe4c05ebb8eafe8e54af553c2913174100fcce675f7e7d3cd3b4efa4a5d/68747470733a2f2f706f7365722e707567782e6f72672f6b6f696e652f7374726f6e672d706172616d65746572732f762f756e737461626c652e737667)](https://packagist.org/packages/koine/strong-parameters)[![License](https://camo.githubusercontent.com/f1380d9a180f288e95445078a379e4309d49d318e6d720fb1e08777ae8142851/68747470733a2f2f706f7365722e707567782e6f72672f6b6f696e652f7374726f6e672d706172616d65746572732f6c6963656e73652e737667)](https://packagist.org/packages/koine/strong-parameters)[![Dependency Status](https://camo.githubusercontent.com/44843c47c29c3c44845ad97b4040ee6036a7e1ce2385ee6c9afb39fd7ab914d5/68747470733a2f2f67656d6e617369756d2e636f6d2f6b6f696e657068702f5374726f6e67506172616d65746572732e706e67)](https://gemnasium.com/koinephp/StrongParameters)

### Usage

[](#usage)

```
use Koine\Parameters;

$params = new Parameters(array(
    'user' => array(
        'name'  => 'Foo',
        'email' => 'Foo@bar.com',
        'admin' => true
     )
));

// throws exception
$userParams = $params->requireParam('user')->permit(array(
    'name',
    'email',
));

// filters value
Parameters::$throwsException = false;

$userParams = $params->requireParam('user')->permit(array(
    'name',
    'email',
))->toArray(); // array('name' => 'Foo', 'email' => 'Foo@bar.com')

// nested params

$params = new Params(array(
    'book' => array(
        'title'   => 'Some Title',
        'edition' => '3',
        'authors' => array(
            array(
                'name'     => 'Jon',
                'birthday' => '1960-01-02',
            ),
            array(
                'name'     => 'Daniel',
                'birthday' => '1960-01-02',
            ),
        )
    ),
    'foo' => 'bar',
    'bar' => 'foo'
));

$params->permit(array(
    'book' => array(
        'authors' => array('name'),
        'title'
    ),
    'foo'
))->toArray();

/**
    array(
        'book' => array(
            'title'   => 'Some Title',
            'authors' => array(
                array('name' => 'Jon'),
                array('name' => 'Daniel'),
            )
        ),
        'foo' => 'bar'
  )
*/

// array params

$params = new Params(array(
    'tags' => array('php', 'ruby')
));

$params->permit(array('tags' => array()))->toArray();
// array( 'tags' => array('php', 'ruby'))

// array params with invalid data

$params = new Params(array(
    'tags' => 'invalid'
));

$params->permit(array('tags' => array()))->toArray(); // array()

// do something with the values
```

### Installing

[](#installing)

#### Via Composer

[](#via-composer)

Append the lib to your requirements key in your composer.json.

```
{
    // composer.json
    // [..]
    require: {
        // append this line to your requirements
        "koine/strong-parameters": "~0.9.3"
    }
}
```

### Alternative install

[](#alternative-install)

- Learn [composer](https://getcomposer.org). You should not be looking for an alternative install. It is worth the time. Trust me ;-)
- Follow [this set of instructions](#installing-via-composer)

### Issues/Features proposals

[](#issuesfeatures-proposals)

[Here](https://github.com/koinephp/StrongParameters/issues) is the issue tracker.

Contributing
------------

[](#contributing)

Please refer to the [contribuiting guide](https://github.com/koinephp/StrongParameters/blob/master/CONTRIBUTING.md).

### License

[](#license)

[MIT](MIT-LICENSE)

### Authors

[](#authors)

- [Marcelo Jacobus](https://github.com/mjacobus)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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 ~1 days

Total

4

Last Release

4288d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/226834?v=4)[Marcelo Jacobus](/maintainers/mjacobus)[@mjacobus](https://github.com/mjacobus)

---

Top Contributors

[![mjacobus](https://avatars.githubusercontent.com/u/226834?v=4)](https://github.com/mjacobus "mjacobus (44 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/koine-strong-parameters/health.svg)

```
[![Health](https://phpackages.com/badges/koine-strong-parameters/health.svg)](https://phpackages.com/packages/koine-strong-parameters)
```

###  Alternatives

[akaunting/laravel-setting

Persistent settings package for Laravel

490857.9k7](/packages/akaunting-laravel-setting)[yurunsoft/phpmailer-swoole

PHPMailer 支持 Swoole 协程环境

31188.7k11](/packages/yurunsoft-phpmailer-swoole)[odan/tsid

A library for generating Time Sortable Identifiers (TSID).

25242.5k](/packages/odan-tsid)[rochamarcelo/cake-pimple-di

A cakephp plugin for dependency injection based on Pimple library

12180.8k](/packages/rochamarcelo-cake-pimple-di)

PHPackages © 2026

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