Package Data | |
---|---|
Maintainer Username: | mikelmi |
Maintainer Contact: | mikelmi84@gmail.com (mike_lmi) |
Package Create Date: | 2016-08-15 |
Package Last Update: | 2017-05-22 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-16 15:00:13 |
Package Statistics | |
---|---|
Total Downloads: | 71 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Build on AngularJS 1.5, Bootstrap 4
$ composer require mikelmi/mks-admin
$ php artisan vendor:publish --provider="Mikelmi\MksAdmin\Providers\AdminServiceProvider"
For accessing the admin panel User should have 'admin.access' ability (you can define it by Gate::define()
).
See https://laravel.com/docs/master/authorization#gates for details
Implement AdminableUserInterface by your User model
// app/User.php
<?php
//...
use Mikelmi\MksAdmin\Contracts\AdminableUserInterface;
class User extends Authenticatable implements AdminableUserInterface {
//...
public function isSuperAdmin(): bool
{
//TODO: return true if user is SuperAdmin
return false;
}
}
config/admin.php
file:<?php
return [
//...
'reset_enable' => true,
Mikelmi\MksAdmin\Traits\AdminableUser
Trait to your User modelBy default the menu items are built by \Mikelmi\MksAdmin\Services\SimpleMenu
class and configured in the config/admin.php
. E.g:
'menu_manager' => \Mikelmi\MksAdmin\Services\SimpleMenu::class,
'menu' => [
['title'=>'Home', 'url'=>'#/home', 'hash'=>'home', 'icon'=>'home'],
['title'=>'Users', 'url'=>'#/users', 'hash'=>'users', 'icon'=>'user'],
],
But you can change the default menu manager class by your own which should implements Mikelmi\MksAdmin\Contracts\MenuManagerContract