PHP code example of nocturnalsm / approval

1. Go to this page and download the library: Download nocturnalsm/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/ */

    

nocturnalsm / approval example snippets



// whenever a model is created, updated, or deleted, such as this:
$model->save();
// will generate an approval request to be approved or rejected

// and then a user can respond to it by
$user->respondApproval($model, ApprovalResponse::STATUS_APPROVE);