dev-master
9999999-dev
MIT
The Requires
Wallogit.com
2017 © Pedro Peláez
require the project using Composer:, (*1)
composer require eklundkristoffer/administer
or manually update your require block and run composer update, (*2)
{
"require": {
"eklundkristoffer/administer": "~0.1"
}
}
Your user model should also be extending Administers own user model:, (*3)
namespace App\User;
use Administer\Models\User as Administer;
class User extends Administer
{
//
}
If you want a administer to login using email for example, you will have to update $username property in your user model. Administer is using username and password fields on default., (*4)
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';
}
By adding a model to the models array in config/administer.php Administer will then automatically let you edit the model records from the web. You can with ease define which fields that can be edited, and which fields that should be shown in the presentation list., (*5)
'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*}
MIT