PHP code example of adamhut / approvable

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

    

adamhut / approvable example snippets



use Illuminate\Foundation\Auth\User as Authenticatable;
use Adamhut\Approvable\Traits\Approvable;

class User extends Authenticatable
{
    use Approvable;

    // ...
}

$user->isPending(); //true
$user->isApproved() //false
$user->isDenied();  //false

$user->approve();

$user->isApproved() //true
$user->isPending(); //false
$user->isDenied(); //false

$user->deny();
$user->isDenied()   //true
$user->isApproved() //false
$user->isPending(); //false


 
php artisan approval:summary

 php

php artisan vendor:publish --provider="Adamhut\Approvable\ApprovableServiceProvider" --tag="migrations"

php artisan migrate