PHP code example of halaabdulmottleeb / bitmask-permissions
1. Go to this page and download the library: Download halaabdulmottleeb/bitmask-permissions 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/ */
halaabdulmottleeb / bitmask-permissions example snippets
enum PostPermission: int
{
case READ = 1; // 0001
case WRITE = 2; // 0010
case UPDATE = 4; // 0100
case DELETE = 8; // 1000
}
use HalaAbdulmottleb\BitmaskPermissions\Traits\HasBitmaskPermissions;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
use HasBitmaskPermissions;
}