spatie/laravel-enum
Laravel integration for spatie/enum: use Enum base class in Laravel, cast model attributes to enums (including nullable and arrays), and get Laravel-friendly behavior via custom casts and Castable support for Eloquent.
Full Changelog: https://github.com/spatie/laravel-enum/compare/3.1.0...3.2.0
Full Changelog: https://github.com/spatie/laravel-enum/compare/3.0.3...3.1.0
Full Changelog: https://github.com/spatie/laravel-enum/compare/3.0.2...3.0.3
$request->input() and not with $request->query->get() anymore:- $request->query->get('status')
+ $request->input('status')
InputBag request object, you'll need to use all()[''] instead of get():- $request->request->get('status');
+ $request->request->all()['status'];
:attribute replacement in \Spatie\Enum\Laravel\Rules\EnumRule::message() to respect custom attribute translations - #77Spatie\Enum\Laravel\Http\Middleware\TransformEnums middleware in favor of route bindingWarning: the dropped
TransformEnumsmiddleware was unusable - but if you've found a way to use it in your project this release will be breaking and you will have to switch to form requests or route binding.
\Spatie\Enum\Laravel\Rules\EnumRule with invalid types passed in - #54upgrade spatie/enum to v3 - spatie/enum#56
drop PHP support for 7.2 and 7.3
drop Laravel support for 5.8 and 6.0 and 7.0
drop several custom exceptions:
ExpectsArrayOfEnumsFieldInvalidEnumErrorNoSuchEnumFieldreplace HasEnums trait by custom casts and default laravel query builder logic
add custom casts EnumCast and EnumCollectionCast
reduce make:enum command to --method option - no value/label mapping or method name formatting any more
add Laravel focused base Enum class which implements Jsonable, Castable
drop enum_index|EnumIndexRule, enum_name|EnumNameRule and enum_value|EnumValueRule validation rules
add Faker provider to generate random enum instances, values and labels \Spatie\Enum\Laravel\Faker\FakerEnumProvider
add request transformer #7
Spatie\Enum\Laravel\Http\Requests\TransformsEnumsSpatie\Enum\Laravel\Http\Middleware\TransformEnumsIlluminate\Http\Request::transformEnums()How can I help you explore Laravel packages today?