1

Problema:

Eu estou usando o template AdminLTE 2 (template muito bom!) no projeto que usa o Framework Laravel. Consegui incluir todos os arquivos e configurar o layout para ser exibido no SideBar e tudo funciona bem. No entanto, o item de menu filho que deve ser expandidp quando o menu pai é acionado, não funciona e também a minimização do SideBar não está funcionando.

A imagem a seguir apresenta o problema, Ao tentar abrir o menu de "Cadastros" ou tentar minimizar o "SideBar" a partir da tela de "Projetos" estas funcionalidades não funcionam e aparece na URL o símbolo "#".

inserir a descrição da imagem aqui
DevTools: abas de network e console


inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

Exceções: Mas, se eu tentar minimizar o SideBar e expandir o menu de cadastros a partir da tela de Dashboard estas funcionalidades funcionam perfeitamente, segue as imagens.

SideBar minimizado inserir a descrição da imagem aqui

Menu de cadastro expandido inserir a descrição da imagem aqui Eu não sei o que fazer realmente. Por favor, eu preciso de ajuda. Eu procurei por uma solução difícil por semanas e não encontrei nada que ajude.

Arquivo: adminlte.php configura o SideBar do template

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Title
    |--------------------------------------------------------------------------
    |
    | The default title of your admin panel, this goes into the title tag
    | of your page. You can override it per page with the title section.
    | You can optionally also specify a title prefix and/or postfix.
    |
    */

    'title' => '',

    'title_prefix' => '',

    'title_postfix' => '',

    /*
    |--------------------------------------------------------------------------
    | Logo
    |--------------------------------------------------------------------------
    |
    | This logo is displayed at the upper left corner of your admin panel.
    | You can use basic HTML here if you want. The logo has also a mini
    | variant, used for the mini side bar. Make it 3 letters or so
    |
    */



     'logo' => '<img src="/img/Logo-UNION.png" alt="Union"  height="40px" width="70px">',

    // 'logo_mini' => É exibido quando o menu é minimizado
     'logo_mini' => '<img src="/img/Icon-UNION.png" alt="Union"  height="35px" width="25px">',


    /*
    |--------------------------------------------------------------------------
    | Skin Color
    |--------------------------------------------------------------------------
    |
    | Choose a skin color for your admin panel. The available skin colors:
    | blue, black, purple, yellow, red, and green. Each skin also has a
    | ligth variant: blue-light, purple-light, purple-light, etc.
    |
    */

    'skin' => 'blue',

    /*
    |--------------------------------------------------------------------------
    | Layout
    |--------------------------------------------------------------------------
    |
    | Choose a layout for your admin panel. The available layout options:
    | null, 'boxed', 'fixed', 'top-nav'. null is the default, top-nav
    | removes the sidebar and places your menu in the top navbar
    |
    */

    'layout' => null,

    /*
    |--------------------------------------------------------------------------
    | Collapse Sidebar
    |--------------------------------------------------------------------------
    |
    | Here we choose and option to be able to start with a collapsed side
    | bar. To adjust your sidebar layout simply set this  either true
    | this is compatible with layouts except top-nav layout option
    |
    */

    'collapse_sidebar' => false,

    /*
    |--------------------------------------------------------------------------
    | URLs
    |--------------------------------------------------------------------------
    |
    | Register here your dashboard, logout, login and register URLs. The
    | logout URL automatically sends a POST request in Laravel 5.3 or higher.
    | You can set the request to a GET or POST with logout_method.
    | Set register_url to null if you don't want a register link.
    |
    */

    'dashboard_url' => 'dashboard',

    'logout_url' => 'logout',

    'logout_method' => null,

    'login_url' => 'login',

    'register_url' => 'register',

    /*
    |--------------------------------------------------------------------------
    | Menu Items
    |--------------------------------------------------------------------------
    |
    | Specify your menu items to display in the left sidebar. Each menu item
    | should have a text and and a URL. You can also specify an icon from
    | Font Awesome. A string instead of an array represents a header in sidebar
    | layout. The 'can' is a filter on Laravel's built in Gate functionality.
    |
    */

    'menu' => [
        'PRINCIPAL',

        [
            'text'        => 'Dashboard',
            'url'         => 'dashboard',
            'icon'        => 'tachometer',
            // 'label'       => ,
           // 'label_color' => 'success',
        ],
        'ADMINISTRATIVO',
        [
            'text' => 'Projetos',
            'url'  => 'projetos/projeto',
            'icon' => 'archive',
        ],
        'CADASTROS',
        [
            'text' => 'Cadastros',
            'icon' => 'file',
            'submenu' => [
                [
                    'text' => 'Categoria do Instrumento',
                    'url'  => 'categoriaInstrumentos/categoriaInstrumento',
                ],
                [
                    'text'  => 'Checklist de Modelos',
                    'url'   => 'checklistsModelos/checklistModelo',
                ],
                [
                    'text'  => 'Checklist de Itens',
                    'url'   => 'checklistsItens/checklistItem',
                ],
              /*   [
                    'text'  => 'Checklist de Estrutura',
                    'url'   => 'checklistsEstruturas/checklistEstrutura',
                ], */
                [
                    'text'  => 'Elemento de Despesa',
                    'url'   => 'elementosDespesas/elementoDespesa',
                ],
                [
                    'text'  => 'Fonte de Recurso',
                    'url'   => 'fontesRecursos/fonteRecurso',
                ],
                [
                    'text'  => 'Localidade',
                    'url'   => 'localidades/localidade',
                ],
                [
                    'text'  => 'Modalidade de Apoio',
                    'url'   => 'modalidadesApoios/modalidadeApoio',
                ],
                [
                    'text'  => 'Modalidade de Licitação',
                    'url'   => 'modalidadesLicitacoes/modalidadeLicitacao',
                ],
                [
                    'text'  => 'País',
                    'url'   => 'paises/pais',
                ],
                [
                    'text'  => 'Projeto de Atividade',
                    'url'   => 'projetosAtividades/projetoAtividade',
                ],
                [
                    'text'  => 'Proponente',
                    'url'   => 'proponentes/proponente',
                ],
                [
                    'text'  => 'Contatos do Proponente',
                    'url'   => 'contatosProponentes/contatoProponente',
                ], 
                [
                    'text'  => 'Setor',
                    'url'   => 'setores/setor',
                ],
                [
                    'text'  => 'Território Turístico',
                    'url'   => 'territoriosTuristicos/territorioTuristico',
                ],
                [
                    'text'  => 'Tipo de Projetos (Eventos)',
                    'url'   => 'tiposProjetos/tipoProjeto',
                ],
                [
                    'text'  => 'UF',
                    'url'   => 'ufs/uf',
                ],
                [
                    'text'  => 'Zona Turística',
                    'url'   => 'zonasTuristicas/zonaTuristica',
                ],


            ],
        ],
        'CONTROLE DE ACESSO',
        [   'text' => 'Controle de Acesso',
            'icon' => 'users',
            'submenu' => [
            [
                'text'       => 'Usuários',
                'url'         => 'usuarios/usuario',
                'icon_color' => 'red',
            ],
            [
                'text'       => 'Perfis',
                'url'         => 'perfis-usuarios/role',
                'icon_color' => 'yellow',
            ],
            [
                'text'       => 'Rotas',
                'url'         => 'rotas/rota',
                'icon_color' => 'aqua',
            ],
            ]],
    ],

    /*
    |--------------------------------------------------------------------------
    | Menu Filters
    |--------------------------------------------------------------------------
    |
    | Choose what filters you want to include for rendering the menu.
    | You can add your own filters to this array after you've created them.
    | You can comment out the GateFilter if you don't want to use Laravel's
    | built in Gate functionality
    |
    */

    'filters' => [
        JeroenNoten\LaravelAdminLte\Menu\Filters\HrefFilter::class,
        JeroenNoten\LaravelAdminLte\Menu\Filters\ActiveFilter::class,
        JeroenNoten\LaravelAdminLte\Menu\Filters\SubmenuFilter::class,
        JeroenNoten\LaravelAdminLte\Menu\Filters\ClassesFilter::class,
        JeroenNoten\LaravelAdminLte\Menu\Filters\GateFilter::class,
    ],

    /*
    |--------------------------------------------------------------------------
    | Plugins Initialization
    |--------------------------------------------------------------------------
    |
    | Choose which JavaScript plugins should be included. At this moment,
    | only DataTables is supported as a plugin. Set the value to true
    | to include the JavaScript file from a CDN via a script tag.
    |
    */

    'plugins' => [
        'datatables' => true,
        'select2'    => true,
        'chartjs'    => true,
    ],
];
1
  • Eu particularmente prefiro adicionar esses arquivo normal mesmo, tipo usando <script src""></script> e <link href="" rel="stylesheed"> na página. Eu uso no Laravel e funciona perfeito 24/07/2018 às 18:27

0

Você deve fazer log-in para responder a esta pergunta.

Pesquise outras perguntas com a tag .