PHP code example of mouhamedfd / permissions-generator

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

    

mouhamedfd / permissions-generator example snippets

 bash
public function __construct()//#
{
    $this->middleware('auth');
    $this->middleware(['permission:posts.specialaction'])->only(['specialaction']);
    $this->middleware(['permission:posts.anotheraction'])->only(['anotheraction']);
        
 }//#

bash
php artisan vendor:publish --tag=permissions-generator.config
bash
php artisan permission:generate

bash
php artisan permission:generate --action=database

bash
php artisan permission:generate --action=controllers