Releases: dshafik/bag
Fix Eloquent Casting for Non-Bag Values
This is a bug fix release that resolves an issue where non-Bag values were cast incorrectly when using Eloquent casting
Support named and positional arguments when instantiating a Bag
New Features
With this release Bag now supports the ability to create new instances by passing in named or positional arguments. (docs)
To get auto-complete in your editor, you will need to add @method
phpdocs to your bag class. This can be automated using artisan make:bag <Bag> --docs --update
. (docs)
Full Changelog: 1.2.2...1.3.0
Fix null support for Magic Casts
Fixes
- Fix an issue where
MagicCast
would error when casting to Bag objects, and would be less strict when casting to other types (i.e. it would act likestrict_types
was off,null -> int = 0
)
Full Changelog: 1.2.1...1.2.2
Add support for Unique and Exists Validation Rules
New Features
This release adds support for Laravel's Unique
and Exists
database-based validations.
Migrated to Pest tests, Initial PHP 8.4 support
New Features
Pest Tests Migration
This release migrates the test suite to use the Pest test framework, with support for both Pest 2 and Pest 3 (specifically for coverage annotations).
Initial Support for PHP 8.4
With the impending release of PHP 8.4, Bag can now be installed on PHP 8.4, however you must use composer update --ignore-platform-reqs
as many dependencies don't yet officially support it. This is primarily to aid in testing on PHP 8.4.
Changes
- Default
fromJsonString
transformer — in order to support both Laravel 10 and 11 properly it was necessary to add a defaultfromJsonString
transformer, you can read more here
Fixes
- Eloquent Model support now works correctly on Laravel 10
- You can now pass in Bag objects directly when creating a collection instead of just an array of bag values
- Faker can now be used in Factories outside of Laravel
Full Changelog: 1.1.0...1.2.0
Add artisan make:bag command
New Features
Artisan make:bag
command
This release adds support for a new artisan make:bag
command to make creating Bag Value objects, Collections, and especially Factories quicker.
Learn more in the documentation.
Full Changelog: 1.0.0...1.1.0
Bag 1.0
This is the initial release of Bag.
New Contributors
- @dshafik (creator)
- @elazar made their first contribution in #6
- @raphaelstolt made their first contribution in #4
Full Changelog: https://github.com/dshafik/bag/commits/1.0.0