Download the PHP package everully/laravel-enum-on-steroids without Composer
On this page you can find all versions of the php package everully/laravel-enum-on-steroids. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download everully/laravel-enum-on-steroids
More information about everully/laravel-enum-on-steroids
Files in everully/laravel-enum-on-steroids
Package laravel-enum-on-steroids
Short Description This package provides Enum trait to speed up the development of Laravel applications.
License MIT
Homepage https://github.com/everully/everully/laravel-enum-on-steroids
Informations about the package laravel-enum-on-steroids
Laravel Enum on steroids
This package provides Enum trait to speed up the development of Laravel applications.
Requirements
- Laravel 9.0 or later.
- PHP 8.1 or later.
Installation
Install via composer: `
Usage
Add the EnumOnSteroids
trait to your Enum class to add some useful methods.
Available methods
Equals
Check if the enum is equal to another enum or a string.
Values
Return an array all the values of the enum.
Names
Return an array of all the names of the enum.
Collection
Return a Laravel collection of all the values of the enum.
Collect
Return a Laravel collection of all the values of the enum.
If provided string or object is not a valid enum value, the collection will not contain it.
Has
Returns true if the enum has the provided value.
Has any
Returns true if the enum has any of the provided values.
Has all
Returns true if the enum has all the provided values.