PHP code example of marcocastignoli / authorization

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

    

marcocastignoli / authorization example snippets


// Enable Facades
$app->withFacades();

// Enable Eloquent
$app->withEloquent();

// Register the service provider
$app->register(marcocastignoli\authorization\AuthorizationProvider::class);

// Get information about my user using the permission set in the authorizations table
App\User::show("my")->get();

// Edit all cars where id < 5
App\Cars::where("id", "<", 5)->post("*", [
    "color"=>"red"
]);
bootstrap/app.php
bash
# Create new tables
php artisan migrate

# Seed the database
php artisan db:seed --class=marcocastignoli\\authorization\\AuthorizationSeeder