Default Views

After installing LAP you will have a new directory in your resources/views folder, specifically resources/views/vendor/lap. In this folder, you will find common views which you can modify to suit the needs of your app.

This includes views for things like the dashboard, settings, general layouts, documentation layouts, the main sidebar menu, and more.

However, sometimes you may need even more control than just the views that come with the installation. If this is the case, simply publish them all by running:

php artisan vendor:publish --provider="Kjjdion\LaravelAdminPanel\LapServiceProvider" --tag="views"

Running said command will publish every single package view in the resources/views/vendor/lap folder.

Colors & Theme

Since LAP uses Bootstrap 4, you can easily customize the colors/theme by modifying the bootstrap.min.css file located in public/lap/css. I recommend using Bootstrap.build for this, as it allows you to easily modify the SCSS values of the Bootstrap 4 defaults, and then export them to a minified CSS file. Then you can just replace the existing bootstrap.min.css file with the one you exported from Bootstrap.build.

Sidebar Menu

The sidebar menu is automatically populated when you use the CRUD generator, however, you can easily customize this menu in resources/views/vendor/lap/layouts/menu.blade.php. The menu supports single-level and multi-level items.

Single level item example:

@can('Read Roles')
    <li{!! request()->is('admin/roles') ? ' class="active"' : '' !!}><a href="{{ route('admin.roles') }}"><i class="fal fa-fw fa-shield-alt mr-3"></i>Roles</a></li>
@endcan

Notice how it will add the active class if the current page is admin/roles.

Multi level items example:

@canany(['Read Roles', 'Read Users', 'Read Activity Logs'])
    <li>
        <a href="#accessControlSubMenu" data-toggle="collapse"{!! request()->is(['admin/roles', 'admin/users', 'admin/activity_logs']) ? ' aria-expanded="true"' : '' !!}>
            <i class="fal fa-fw fa-shield-alt mr-3"></i>Access Control
        </a>
        <ul id="accessControlSubMenu" class="list-unstyled collapse{{ request()->is(['admin/roles', 'admin/users', 'admin/activity_logs']) ? ' show' : '' }}">
            @can('Read Roles')
                <li{!! request()->is('admin/roles') ? ' class="active"' : '' !!}><a href="{{ route('admin.roles') }}">Roles</a></li>
            @endcan
            @can('Read Users')
                <li{!! request()->is('admin/users') ? ' class="active"' : '' !!}><a href="{{ route('admin.users') }}">Users</a></li>
            @endcan
            @can('Read Activity Logs')
                <li{!! request()->is('admin/activity_logs') ? ' class="active"' : '' !!}><a href="{{ route('admin.activity_logs') }}">Activity Logs</a></li>
            @endcan
        </ul>
    </li>
@endcanany

This is a little more complex, but still fairly straight-forward. If the user has any of the perms required, it will show the dropdown. Also, notice how it is set to be expanded & shown if the current page is any of the ones within the submenu. This uses the Bootstrap 4 dropdown logic, so it is important to set a unique href for the link and id for the list e.g. accessControlSubMenu.