All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Missing autoload-dev, tests were autoloaded with the released version (ouch!)
- Fix Laravel Nova status filter
statuses
query scope that accepts multiple statuses names (labels)
creating
event was preventing propagation
- Support for Laravel 9
- Support for Laravel 7
- AttachDefaultStatus event population when creating
- Fix bool return when
setStatus
andstatus
methods
- Camel cased on status checks & toEnums internal functions
- More test coverage
- More methods now accepting enum classes as inputs:
setStatus
&setStatusWhen
- Internal method
checkStatus
- Fixes around conditional assignation
setStatus(['previous' => 'new'])
Status::toEnum
utility method for transform string value to enum objectModel::setStatusWhen
method which works similarly the same assetStatus
- More tests around all the exposed and internal methods
Model::status()
query scope now accepts enum instances
Model::hasStatus()
now accepts enum instances- Required package
spatie/enum
upgraded to v3 - A lot of simplification all over the place
- Deprecated static method
Status::getDefault()
use insteadStatus::defaultFrom($model)
query scope
Status::defaultFrom($model)
local query scopeStatusable::statusesClass
static method to get Statuses enum (can be also replaced to your own path)- Some package tests covering most of its code
Statusable::statuses
static propery has been removed in favor ofStatusable::statusesClass
to be user configurable
- Remove lazy eager load of relation on trait (fixes some issues displaying the status relationship on APIs when not requested)
- Wrong StatusFilter query in Nova
- Support for PHP 8
- Default model status query scope class
- Laravel Nova status filter class
- Support for Laravel 8
- Support for Laravel 5
- HasStatus method returning wrong thing (also documented)
- HasStatus method was returning first string char
- Rename folder / fix namespace (PSR-4)
- Missed config option to the file
- Default to true enable_events config option
- Config option for enable or disable all the package events
- Change trait event from Model's
dispatchesEvents
to passing callbacks methods - Saving from a replaced Model's built-in method to another event (
saving
)
- More fixes around status setter
- Fixed some issues checking statuses on
setStatus(['previous' => 'new'])
- Minor changes to code style
- Improved case sensitivity in get/set statuses
- Events names with spaces
HasStatuses::save()
return bool
- Compatibility with Laravel 7
- Custom model events on status
saving
andsaved
(e.g.savingActive
&savedActive
when save a non active model to active) - EventsServiceProvider (no need to manually add events to your app's events)
- Possible breakchange! Renamed package ServiceProvider (from StatusServiceProvider to ServiceProvider)
- Minor changes and optimisations
- Change default config path for models (following Laravel's default one:
App\Model
)
- Get model class in
Status::getFromEnum()
method (now usingModel::getMorphClass()
)
- More trait fixes around
getMorphClass()
and the new addons
- Custom getter in
HasStatuses
trait for Status custom model
- Get properly the model's morph class by using
getMorphClass()
- checkStatus array_walk to array_map
- case sensitive in setStatusAttribute
- Use custom Status model (customisable in the config file)
- hasStatus didn't load relation properly
- Changes to the config file
- Variable types and names in docblocks
- Case sensitive in status attribute mutator
- Missed namespace on Statusable contract
- Package published on Packagist (composer)