Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
webbingbrasil/dashboard-module / Sidebar / SidebarExtender.php
Size: Mime:
<?php namespace Modules\Dashboard\Sidebar;

use Illuminate\Support\Facades\Auth;
use Maatwebsite\Sidebar\Group;
use Maatwebsite\Sidebar\Item;
use Maatwebsite\Sidebar\Menu;

class SidebarExtender implements \Maatwebsite\Sidebar\SidebarExtender
{
    /**
     * @var Auth
     */
    protected $auth;

    /**
     * @param Auth $auth
     *
     * @internal param Guard $guard
     */
    public function __construct(Auth $auth)
    {
        $this->auth = $auth;
    }

    /**
     * @param Menu $menu
     *
     * @return Menu
     */
    public function extendWith(Menu $menu)
    {
        $menu->group(trans('core::sidebar.main'), function (Group $group) {
            $group->weight(0);

            $group->item(trans('dashboard::dashboard.name'), function (Item $item) {
                $item->weight(0);
                $item->icon('fa fa-' . config('dashboard.icon', 'dashboard'));
                $item->route('dashboard.index');
                $item->isActiveWhen(route('dashboard.index', null, false));
                $item->authorize(true);
            });
        });

        return $menu;
    }
}