Skip to content

3. Menu

Lucas F. Lu edited this page Jan 29, 2020 · 4 revisions

Menu is defined within template file 'vendor/feiron/felaraframe/src/resource/views/sidebar.blade.php', under section "main_menu".

1. Menu can be inserted directly to section "main_menu" as HTMLs

some base blade file, like 'home.blade.php'

@extends('felaraframe::page')

@section('main_menu')
    @parent
    <li class="tm">
        <a href="url/"><i class="fa fa-angle-right"></i><span>My New Menu</span></a>
    </li>
@endsection

2. Menu can also be defined by route names

note: make sure site config for "use_route_as_menu" is set to true.

Name a route with prefix "FrameMenus.", the remaining portion of the route name will be used as menu title.

In route file such as "/routes/web.php"

    Route::get('UserInfo', 'users@info')->name('FrameMenus.UserInfo');

A menu displayed with "UserInfo" will be inserted into the menu section.