You can install the package via composer:
composer require afiqiqmal/approval-laravel
You can publish and run the migrations with:
php artisan vendor:publish --provider="Afiqiqmal\Approval\ApprovalServiceProvider" --tag="migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --provider="Afiqiqmal\Approval\ApprovalServiceProvider" --tag="config"
class Entity extends Model
{
use RequireApproval;
//plenty of public function can be customize
}
class User extends Authenticable
{
use HasApprovable;
//...
//...
}
Include all items including not approve
Model::getQuery()->includeNotApprove()->get();
List all items with not approve
Model::getQuery()->onlyNotApprove()->get();
Approve and Reject Item
$item = Model::first();
$item->approve()->approve($remarks); // optional remarks
$item->approve()->reject($remarks); // optional remarks
Vice versa to get the approval model
$approval = Approval::first();
$approval->approvable; // Get model
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.