1. Go to this page and download the library: Download exceptio/laravel-approval library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
exceptio / laravel-approval example snippets
'providers' => [
...
/**
* Third Party Service Providers...
*/
Exceptio\ApprovalPermission\ApprovalPermissionServiceProvider::class,
],
namespace App\Repositories;
use App\Models\User;
use App\Models\Member;
use Exceptio\ApprovalPermission\Approvable;
class MemberRepository
{
use Approvable;
const DRAFT_DATA = 0; // Draft member
const PENDING_DATA = 1; // Pending member
// rest of your code ...
}
use App\Models\User;
use App\Models\Member;
use Exceptio\ApprovalPermission\Approvable;
class MemberRepository
{
use Approvable;
const DRAFT_DATA = 0; // Draft member
const PENDING_DATA = 1; // Pending member
public function createStepFinal(Request $request)
{
$member = new Member::create([
'name' => 'Test Member',
//so on
]);
$this->notifyApprovalCreate($member);
}
@approvalMenu() //Show Approval menu in your application