fix devops error
This commit is contained in:
@@ -2,31 +2,18 @@
|
||||
|
||||
namespace App\Repositories\Core\Menu;
|
||||
|
||||
use Auth;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Lavary\Menu\Builder as LavaryMenuBuilder;
|
||||
|
||||
/**
|
||||
* Class Builder.
|
||||
*
|
||||
* @property Collection $items;
|
||||
*/
|
||||
class Builder extends LavaryMenuBuilder
|
||||
{
|
||||
private $root = [];
|
||||
|
||||
/**
|
||||
* Adds an item to the menu.
|
||||
*
|
||||
* @param string $title
|
||||
* @param string $options
|
||||
* @return \Lavary\Menu\Item|Item
|
||||
*/
|
||||
public function add($title, $options = '')
|
||||
{
|
||||
$title = sprintf('<span>%s</span>', $title);
|
||||
|
||||
$id = isset($options['id']) ? $options['id'] : $this->id();
|
||||
$id = $options['id'] ?? $this->id();
|
||||
|
||||
$item = new Item($this, $id, $title, $options);
|
||||
|
||||
@@ -37,7 +24,7 @@ class Builder extends LavaryMenuBuilder
|
||||
if (isset($options['role']) || isset($options['permission'])) {
|
||||
$ability = ['admin'];
|
||||
if (isset($options['role'])) {
|
||||
$ability = $ability + explode(',', $options['role']);
|
||||
$ability += explode(',', $options['role']);
|
||||
}
|
||||
|
||||
$permission = null;
|
||||
@@ -57,14 +44,6 @@ class Builder extends LavaryMenuBuilder
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an item to a existing menu item as a submenu item.
|
||||
*
|
||||
* @param $id Id of the menu item to attach to
|
||||
* @param $title Title of the sub item
|
||||
* @param string $options
|
||||
* @return Lavary\Menu\Item
|
||||
*/
|
||||
public function addTo($id, $title, $options = '')
|
||||
{
|
||||
$parent = $this->whereId($id)->first();
|
||||
@@ -72,8 +51,6 @@ class Builder extends LavaryMenuBuilder
|
||||
if (isset($parent)) {
|
||||
if (! isset($this->root[$parent->id])) {
|
||||
$parent->attr(['url' => '#', 'class' => 'treeview']);
|
||||
// $str = '<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>';
|
||||
// $parent->append($str);
|
||||
$this->root[$parent->id] = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user