Download the PHP package kykurniawan/laravel-sb-admin-template without Composer
On this page you can find all versions of the php package kykurniawan/laravel-sb-admin-template. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kykurniawan/laravel-sb-admin-template
More information about kykurniawan/laravel-sb-admin-template
Files in kykurniawan/laravel-sb-admin-template
Package laravel-sb-admin-template
Short Description Laravel SB Admin Template
License MIT
Informations about the package laravel-sb-admin-template
Laravel SB Admin Template
Laravel SB Admin Template is a package that provides an easy way to integrate the popular SB Admin Template into your Laravel project.
Installation
You can install the package via composer:
Install the template:
This will copy the necessary assets (CSS, JS, images, fonts) to your public directory, and configuration file to your config directiory.
Usage
After successfully install the package, we can use the pre-built dashboard layout, simply extend the sb-admin layout in your view:
You may want to add something on your template's head
You can also add something on your template's foot (before body closing tag)
Note:
The @parent directive is keeps default element being loaded (template style, template script).
If you don't add this directive, you need to include template's style or template's script manually
Configuration
The package's configuration file is located at config/laravel-sb-admin-template.php. Here you can customize various aspects of the template, such as the template views, section name, etc.
Template Customization
To customize the template for your project, you can do it in the boot method on the AppServiceProvider using the Facade template provided by this package.
Import template facade and template components:
then, in the boot method on your app service provider:
Template Components Class
Navbar
make()
Initialize the component. This is static method. You need to call this method when create the component.
brandTitle(string|callable)
Set navbar brand title. Accept string or function that returns string.
brandHref(string|callable)
Set navbar brand href link. Accept string or function that returns string.
dropDownIcon(string|callable)
Set navbar dropdown icon. Accept string or function that returns string.
dropDownItems([])
Set the navbar dropdown item. Accept array of NavbarDropDownItem component.
NavbarDropDownItem
make()
Initialize the component. This is static method. You need to call this method when create the component.
type(string)
Set item type. Allowed types: [link, divider, view].
text(string|callable)
Set item text. Only work when item type is link. Accept string or function that returns string.
href(sring|callable)
Set item href link. Only work when item type is link. Accept string or function that returns string.
target(sring|callable)
Set item target link. Only work when item type is link. Accept string or function that returns string.
visible(bool|callable)
Set item visibility. Accept boolean or function that returns boolean.
view(string|callable)
Set item blade view name (from your view folder). Only work if item type is view. Accept string or function that returns string.
Sidebar
make()
Initialize the component. This is static method. You need to call this method when create the component.
sidebarItems([])
Set sidebar menu items. Accept array of SidebarItem component.
sidebarFooter(SidebarFooter)
Set sidebar footer component. Accept object of SidebarItem component.
SidebarItem
make()
Initialize the component. This is static method. You need to call this method when create the component.
type(string)
Set item type. Allowed types: [link, heading].
text(string|callable)
Set item text. Accept string or function that returns string.
href(sring|callable)
Set item href link. Only work when item type is link.
target(sring|callable)
Set item target link. Only work when item type is link. Accept string or function that returns string.
visible(bool|callable)
Set item visibility. Accept boolean or function that returns boolean.
icon(string|callable)
Set item icon. Only work when item type is link. Accept string or function that returns string.
active(bool|callable)
Set item active state. Accept boolean or function that returns boolean. Only work when item type is link.
children([])
Set item children (nested item). Accept array of SidebarItem component. Only work if item type is link.
SidebarFooter
make()
Initialize the component. This is static method. You need to call this method when create the component.
text(string|callable)
Set sidebar footer text. Accept string or function that returns string.
visible(bool|callable)
Set sidebar footer visibility. Accept boolean or function that returns boolean.
Footer
make()
Initialize the component. This is static method. You need to call this method when create the component.
copyright(string|callable)
Set footer copyright text. Accept string or function that returns string.
visible(bool|callable)
Set footer visibility. Accept boolean or function that returns boolean.
Note: request object are passed to all callable functions. Example:
Overriding Template
This package has been made in such a way that you only need to extend the layout. However, if you want more specific needs, you can copy the template's views into your project and make any modifications you want.
To do that, you have to publish the views:
After overriding the template view, you must tell the package to use the view you created instead of the default template view. You can do this through the config file.
Credits
This package was inspired by the SB Admin Template by Start Bootstrap. Special thanks to David Miller for creating this awesome template.
License
The Laravel SB Admin Template package is open-sourced software licensed under the MIT license.
All versions of laravel-sb-admin-template with dependencies
illuminate/view Version ^10.6
illuminate/console Version ^10.6