lundi 24 juin 2019

No despliega el botón de cerrar sesión en mi proyecto de laravel

hace poco realice un make:auth en laravel y lo personalice, cree una un template para almacenar el app.blade.php (barra de navegación o navbar), el footer, estilos, slider, etc. cuando incluyo este template en mis vistas el boto de cerrar sesión no despliega, solo lo hace en la vista home, pero cuando cambio @extends('layouts.app') por @extends('template') que se supone que en el template ya incluí el app'navbar' y pasa lo mismo no depliega el boton de cerrar sesión no entiendo por que.


<!DOCTYPE html>
<html lang="es">
<head>
    <link rel="icon" type="image/png" href="img/inco.png"/>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>@yield('title','Group Binarios')</title>
    <link rel='stylesheet' href="">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>

</head>
<body>


@include('layouts.app')

@include('layouts.footer')





<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">

</body>
</html>

<!DOCTYPE html>
<html lang="">
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="">

    <title></title>

    <!-- Scripts -->
    <script src="" defer></script>

    <!-- Fonts -->
    <link rel="dns-prefetch" href="//fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">

    <!-- Styles -->
    <link href="" rel="stylesheet">
    <link href="" rel="stylesheet">

</head>
<body>
    <div id="app">

        <nav class="navbar navbar-expand-md navbar-light  shadow-sm fixed-top" style="background-color:#f4c508de;">
            <div class="container">
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse" id="navbarSupportedContent">

                   <!-- Left Side Of Navbar -->

                <div class="container" >


                            <center>
                                <img  src="/img/logo.png" style='width:300px'>
                            </center>


                    <div class="row justify-content-center">
                        <div class="col-md-10">

                    <ul class="navbar-nav ml-auto nav-tabs" id="myTab" role="tablist">
                        <li class="nav-item " >
                            <a class="nav-link " href="">
                            Inicio </a>
                        </li>
                        <li class="nav-item  ">
                            <a class="nav-link" href="">Nosotros</a>
                        </li>
                        <li class="nav-item  ">
                            <a class="nav-link" href="">Productos</a>
                        </li>
                        <li class="nav-item  ">
                            <a class="nav-link" href="">Servicios</a>
                        </li>
                        <li class="nav-item  ">
                            <a class="nav-link" href="">Cotizar</a>
                        </li>
                        <li class="nav-item  ">
                            <a class="nav-link" href="#">Webmail</a>
                        </li>
                        <li class="nav-item  ">
                            <a class="nav-link" href="http://soporte.groupbinarios.co/scp">Soporte</a>
                        </li>
                        <li class="nav-item  ">
                            <a class="nav-link" href="#">Contactanos</a>
                        </li>
                        @guest


                            <form class="form-inline">
                                <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
                                <button class="btn btn-primary my-2 my-sm-0" type="submit">Buscar</button>
                            </form>
                            @if (Route::has('register'))

                            @endif
                        @else
                            <div class="nav-item dropdown">
                                <button id="dropdownMenuButton"  class="btn btn-light dropdown-toggle " style="font-size:18px" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
                                    <i class="fa fa-user"></i>    </button> <span class="caret"></span>


                                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
                                    <a class="dropdown-item" href=""
                                       onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();">
                                        
                                        <i class="fa fa-sign-out-alt" style="font-size:18px"></i>
                                    </a>

                                    <form id="logout-form" action="" method="POST" style="display: none;">
                                        @csrf
                                    </form>
                                </div>

                            </div>
                        @endguest
                    </ul>
                        </div>

                        </div>
                    </div>
                </div>


                <!-- Right Side Of Navbar -->
                    <ul class="navbar-nav ml-auto">
                        <!-- Authentication Links -->

                    </ul>
                </div>
            </div>
        </nav>

        <main class="py-4">
            @yield('content')
        </main>
    </div>
</body>
</html>



Route::get('/','IndexController@index' );
Route::get('/nosotros','IndexController@nosotros' );
Route::get('/productos','IndexController@productos' );
Route::get('/servicios','IndexController@servicios' );
Route::get('/cotizar','IndexController@cotizar' );
Route::get('/circuitocerrado','IndexController@circuitocerrado' );


Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');


No despliega el botón de cerrar sesión



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire