首页 > 解决方案 > 根据 Laravel 中的 url 跳过导航栏

问题描述

还使用 Auth System 与 laravel 一起工作。我有以下 app.blade.php 文件

<!-- @guest -->
        <main class="py-4">
        @yield('content')
        </main>
        <!-- @else -->
        <main class="py-4">
        @include('partials._nav')
        
        @yield('content')
            
            @include('partials._footer')   
        </main>
        @endguest
    </div>

对于以下网址 http://localhost:8000/

我的 web.php 是这样的

Route::get('/', [
    'uses' => 'TopicController@index',
    'as'   => 'welcome',
   
]);

但现在我需要跳过@include('partials._nav')上面唯一的 url (http://localhost:8000/) 并且需要在 Auth 条件下显示其他 url。我怎么能管理这个?

标签: phplaravel

解决方案


推荐阅读