Custom Navbar
you can add the html element to the top navigation bar, open app/Admin/bootstrap.php:
use Ezadev\Admin\Facades\Admin;
Admin::navbar(function (\Ezadev\Admin\Widgets\Navbar $navbar) {
$navbar->left('html...');
$navbar->right('html...');
});Methods left and right are used to add content to the left and right sides of the head, the method parameters can be any object that can be rendered (objects which impletements Htmlable, Renderable, or has method __toString()) or strings.
Add elements to the left
For example, add a search bar on the left, first create a view resources/views/search-bar.blade.php:
<style>
.search-form {
width: 250px;
margin: 10px 0 0 20px;
border-radius: 3px;
float: left;
}
.search-form input[type="text"] {
color: #666;
border: 0;
}
.search-form .btn {
color: #999;
background-color: #fff;
border: 0;
}
</style>
<form action="/admin/posts" method="get" class="search-form" pjax-container>
<div class="input-group input-group-sm ">
<input type="text" name="title" class="form-control" placeholder="Search...">
<span class="input-group-btn">
<button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i></button>
</span>
</div>
</form>Then add it to the head navigation bar:
Add elements to the right
You can only add the <li> tag on the right side of the navigation, such as adding some prompt icons, creating a new rendering class app/Admin/Extensions/Nav/Links.php
Then add it to the head navigation bar:
Or use the following html to add a drop-down menu:
More components can be found here Bootstrap
Last updated