Skip to content

Commit

Permalink
Merge pull request #1659 from z-song/1.5
Browse files Browse the repository at this point in the history
1.5
  • Loading branch information
z-song authored Jan 23, 2018
2 parents c1b3895 + 512d9a0 commit 4fd32e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Auth/Database/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
*/
class Menu extends Model
{
use ModelTree, AdminBuilder;
use AdminBuilder, ModelTree {
ModelTree::boot as treeBoot;
}

/**
* The attributes that are mass assignable.
Expand Down Expand Up @@ -74,7 +76,7 @@ public function allNodes() : array
*/
protected static function boot()
{
parent::boot();
static::treeBoot();

static::deleting(function ($model) {
$model->roles()->detach();
Expand Down
1 change: 1 addition & 0 deletions src/Controllers/MenuController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function index()
$form->icon('icon', trans('admin.icon'))->default('fa-bars')->rules('required')->help($this->iconHelp());
$form->text('uri', trans('admin.uri'));
$form->multipleSelect('roles', trans('admin.roles'))->options(Role::all()->pluck('name', 'id'));
$form->hidden('_token')->default(csrf_token());

$column->append((new Box(trans('admin.new'), $form))->style('success'));
});
Expand Down

0 comments on commit 4fd32e4

Please sign in to comment.