v2.5.2
Giriş yap

Dashboard Url Sabit değil

okumusmr
535 defa görüntülendi

Dashboard navbar menüsünü oluşturmak için db den gelen verileri foreach ile döndürüyorum ancak url her menude farklılasıyor. Örnegin olması gerekn url /dash/settings/general iken bu adreste farklı bir menüye geçmeye çalıştığımda tanımlanan url'in başına bulunduğum link geliyor. /dash/settings/general/dash/blog/addgibi

Döngüm şu şekilde;


 <ul class="navigation navigation-main">
            @foreach( $dashboardMenuItems as $dashboardMenuItem)
                <li class=" nav-item">
                    <a href="{{ getenv('DASH_BASE_URL') . $dashboardMenuItem->menu_sub_slug .'/'. $dashboardMenuItem->menu_url }}">
                        <i class="{{ $dashboardMenuItem->menu_icon }}"></i>
                        <span
                            class="menu-title"
                            data-i18n="{{ $dashboardMenuItem->menu_title }}">
                            {{ __( $dashboardMenuItem->menu_title) }}
                        </span>
                    </a>
                    @foreach( $dashboardSubMenuItems as $dashboardSubMenuItem)
                        @if( $dashboardMenuItem->id == $dashboardSubMenuItem->menu_id)
                            <ul class="menu-content">
                                <li>
                                    <a href="{{ getenv('DASH_BASE_URL') . $dashboardMenuItem->menu_sub_slug .'/'. $dashboardSubMenuItem->menu_url }}">
                                        <i class="fa fa-circle"></i>
                                        <span
                                            class="menu-item"
                                            data-i18n="{{ $dashboardSubMenuItem->menu_title }}">
                                            {{ __( $dashboardSubMenuItem->menu_title ) }}
                                        </span>
                                    </a>
                                </li>
                            </ul>
                        @endif
                    @endforeach
                </li>
            @endforeach
        </ul>
sync
1339 gün önce
<ul class="navigation navigation-main">
            @foreach( $dashboardMenuItems as $dashboardMenuItem)
                <li class=" nav-item">
                    <a href="{{ '/' . getenv('DASH_BASE_URL') . $dashboardMenuItem->menu_sub_slug .'/'. $dashboardMenuItem->menu_url }}">
                        <i class="{{ $dashboardMenuItem->menu_icon }}"></i>
                        <span
                            class="menu-title"
                            data-i18n="{{ $dashboardMenuItem->menu_title }}">
                            {{ __( $dashboardMenuItem->menu_title) }}
                        </span>
                    </a>
                    @foreach( $dashboardSubMenuItems as $dashboardSubMenuItem)
                        @if( $dashboardMenuItem->id == $dashboardSubMenuItem->menu_id)
                            <ul class="menu-content">
                                <li>
                                    <a href="{{ '/' . getenv('DASH_BASE_URL') . $dashboardMenuItem->menu_sub_slug .'/'. $dashboardSubMenuItem->menu_url }}">
                                        <i class="fa fa-circle"></i>
                                        <span
                                            class="menu-item"
                                            data-i18n="{{ $dashboardSubMenuItem->menu_title }}">
                                            {{ __( $dashboardSubMenuItem->menu_title ) }}
                                        </span>
                                    </a>
                                </li>
                            </ul>
                        @endif
                    @endforeach
                </li>
            @endforeach
        </ul>