PHP code example of tzm / authorizator

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

    

tzm / authorizator example snippets


use App\Services\AuthorizationActions\Transaction;

class TransactionController extends Controller
{
    public function create()
    {
        return Transaction::createAuth()->response();
    }
}

protected $allowedChannels = [
    EmailChannel::class,
    SmsChannel::class,
];

use App\Services\AuthorizationActions\Transaction;

class TransactionController extends Controller
{
    public function create()
    {
        return Transaction::createAuth()->response();
    }
}
 
VerifyPhoneAction::createAuth()->sendCode(SmsChannel::class)

protected function mapAuthorizatorRoutes(){
    Route::middleware('web')
        ->namespace($this->namespace)
        ->group(base_path('routes/authorizator.php'));
}

    public function map()
    {
        //...
        $this->mapAuthorizatorRoutes();
    }
bash
php artisan authorizator:make-action
bash
php artisan authorizator:make-channel
bash
php artisan authorizator:make-channel
bash
php artisan authorizator:make-action
bash
php artisan vendor:publish --tag=authorizator.views
bash
php artisan vendor:publish --tag=authorizator.migrations
bash
php artisan vendor:publish --tag=authorizator.views
bash
php artisan vendor:publish --tag=authorizator.vue
bash
php artisan authorizator:purge