Download the PHP package adamcmoore/laravel-approvable without Composer
On this page you can find all versions of the php package adamcmoore/laravel-approvable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adamcmoore/laravel-approvable
More information about adamcmoore/laravel-approvable
Files in adamcmoore/laravel-approvable
Package laravel-approvable
Short Description Require approval of changes to eloquent models
License MIT
Informations about the package laravel-approvable
Laravel Approvable
A package to require the approval of changes to Eloquent Models.
Supports Laravel version 10.
Setup
Require Package
composer require adamcmoore/laravel-approvable
Publish & run migrations
php artisan vendor:publish --provider "AcMoore\Approvable\ApprovableServiceProvider" --tag="migrations"
php artisan migrate
Set models requiring approval
Setup related models requiring approval
Usage example
...
Force draft creation when updating
Creating and Deleting will always create a draft when approval is enabled.
Updating will only create a draft when model attributes have been changed.
To always taking a draft, even when no data has been changed, use Model::forceDraft();
after Model::enableApproval()
.
Eloquent Model Events
Model events are fired on the Approvable Model when the status of its draft changes. These can be listened to with an Observer. Events triggered are:
new_draft
approved
rejected
dropped
applied
Todo
- [x] Add support for creating & deleting non-relation records
- [ ] Test & support for other types of relations, other than belongsTo
All versions of laravel-approvable with dependencies
illuminate/console Version ^10
illuminate/database Version ^10
illuminate/filesystem Version ^10