PHP code example of eklundkristoffer / administer

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

    

eklundkristoffer / administer example snippets


namespace App\User;

use Administer\Models\User as Administer;

class User extends Administer
{
    //
}

namespace App\User;

use Administer\Models\User as Administer;

class User extends Administer
{
    /**
    * Field to be used as username during authentication.
    *
    * @var string
    */
   protected $username = 'username';

   /**
    * Field to be used as password during authentication.
    *
    * @var string
    */
   protected $password = 'password';
}

'models' => [
    App\User::class => [
        'present_fields' => ['username', 'email'],
        'editable_fields' => ['username', 'email']
    ]
],

php artisan administer:user:addrole {user_id} {roles*}

php artisan administer:user:deleterole {user_id} {roles*}