PHPackages                             binarycabin/options - 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. binarycabin/options

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

binarycabin/options
===================

Class-based select options for Laravel

1.0.0(7y ago)11.1k↓87.5%MITPHP

Since Mar 5Pushed 7y agoCompare

[ Source](https://github.com/binarycabin/options)[ Packagist](https://packagist.org/packages/binarycabin/options)[ RSS](/packages/binarycabin-options/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

Options
=======

[](#options)

[![Build Status](https://camo.githubusercontent.com/8197fa9c13e43cca6d334561902e2abfa56a3f1a6a9efa82199c64316240dcbd/68747470733a2f2f7472617669732d63692e6f72672f62696e617279636162696e2f6f7074696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/binarycabin/options)[![StyleCI](https://camo.githubusercontent.com/0ebaf9de968145df52f11271bee6daa3c0b238bc1d1b3af8c7f4b6b165558f3e/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3137343031353631342f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/174015614)[![Latest Stable Version](https://camo.githubusercontent.com/0d0ca1080fb85827d9378bac0d0ef77727ae764f1a92b3ef377ab0d90c9526dd/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62696e617279636162696e2f6f7074696f6e732e7376673f7374796c653d666c6174)](https://packagist.org/packages/binarycabin/options)[![Total Downloads](https://camo.githubusercontent.com/ddb85e709a9075c7616a38d87197644fc5a52b7da881398449b1a3ff5e9ed14c/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62696e617279636162696e2f6f7074696f6e732e7376673f7374796c653d666c6174)](https://packagist.org/packages/binarycabin/options)

Class-based select options for Laravel.

This package makes it easy to store a static list of array items. This is useful in form select-list building.

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

[](#installation)

```
composer require binarycabin/options

```

Usage
-----

[](#usage)

### Generate Permissions

[](#generate-permissions)

```
php artisan make:option CLASSNAME

```

ie:

```
php artisan make:option County

```

This will create a new file located at: /app/Options/Country.php

### Edit your array

[](#edit-your-array)

In your generated option file, edit the array in the getArray method to include the available option items:

```
public function getArray(){
  return [
    'US' => 'United States of America',
    'CA' => 'Canada',
  ];
}

```

### Display the option

[](#display-the-option)

```
foreach(\App\Options\County::get('---') as $optionKey => $optionValue)
{
  echo '{{ $optionValue }}'
}

```

or using something like anahkiasen/former:

```
{!! Former::select()->options(\App\Options\County::get('---')) !!}

```

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

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

2677d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33656106?v=4)[Binary Cabin](/maintainers/binarycabin)[@binarycabin](https://github.com/binarycabin)

---

Top Contributors

[![kilrizzy](https://avatars.githubusercontent.com/u/132478?v=4)](https://github.com/kilrizzy "kilrizzy (25 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/binarycabin-options/health.svg)

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

PHPackages © 2026

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