Download the PHP package httpfactory/approvals without Composer
On this page you can find all versions of the php package httpfactory/approvals. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package approvals
Approval System
The approval system package is an add-on package that allows seamless integration into laravel 5.7+
Installation
To install simply pull in the package to your laravel project
composer install httpfactory\approvals
After you have successfully installed it via composer, you will need to
register the package in your config\app.php
file.
Add the following line to your service providers array :
Httpfactory\Approvals\ApprovalServiceProvider::class
Now you need to run the following command :
php artisan vendor:publish --provider=Httpfactory\Approvals\ApprovalServiceProvider
After registering the package, you will need to run migrations
Run The Migrations
you must run your migrations as follows
php artisan migrate
Events
You will need to add the following events to the app\Providers\EventServiceProvider.php
-
ApprovalRequest
Httpfactory\Approvals\Events\ApprovalRequest
- Fires when someone sends an approval request.
-
ApprovalApproved
Httpfactory\Approvals\Events\ApprovalApproved
- Fires when an "approver" approves the approval request.
-
ApprovalDeclined
Httpfactory\Approvals\Events\ApprovalDeclined
- Fires when an "approver" declines the approval request.
-
ApprovalAwarded
Httpfactory\Approvals\Events\ApprovalAwarded
- Fires when the approval configuration requirements are met and the approval is automatically awarded.
- ApprovalDenied
Httpfactory\Approvals\Events\ApprovalDenied
- Fires when the approval configuration requirements are met and the approval is automatically denied.
The Events should look something like the code below
Usage
There are multiple types of approvals :
- Quick Approval ( 1 to 1 )
- Group Approval ( a group of users must approve/deny )
- MultiTier Approval ( multiple groups must approve/deny )
Quick Approval
Below is an example of a quick approval :
In the example above, we are sending a request to a user for approval.