PHP code example of mvd81 / laravel-is-admin

1. Go to this page and download the library: Download mvd81/laravel-is-admin 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/ */

    

mvd81 / laravel-is-admin example snippets

 artisan migrate

use Mvd81\LaravelIsAdmin\Traits\isAdmin;

class User extends Authenticatable
{
    use isAdmin;
    ...

$user = User::find(ID);
$user->makeAdmin(); 

$user = User::find(ID);
$user->undoAdmin(); 
 artisan vendor:publish

'use_super_admin' => true,

Route::get('admin-page')->middleware('IsAdmin'); 
config/is_admin.php
bash
php artisan command:isAdmin
config/is_admin.php