PHPackages                             hsyir/laravel-adminlte - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. hsyir/laravel-adminlte

ActiveLibrary[Admin Panels](/categories/admin)

hsyir/laravel-adminlte
======================

Easy AdminLTE integration with Laravel

v3.0.12(6y ago)91.8k↓50%MITPHPPHP &gt;=7.2.0

Since Oct 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/hsyir/Laravel-AdminLTE-RTL)[ Packagist](https://packagist.org/packages/hsyir/laravel-adminlte)[ RSS](/packages/hsyir-laravel-adminlte/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (76)Used By (0)

Easy AdminLTE integration with Laravel
======================================

[](#easy-adminlte-integration-with-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4fc0c516030a7a9f4f352106be3bb6052ba2ad19420b4b1ed64d9f3cbd806f68/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a65726f656e6e6f74656e2f4c61726176656c2d41646d696e4c54452e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeroennoten/Laravel-AdminLTE)[![Build Status](https://camo.githubusercontent.com/77bdc8522008d6f3fd9af0f259560c5412e1ada8f11176c279eff1c89a0e928a/68747470733a2f2f7472617669732d63692e6f72672f6a65726f656e6e6f74656e2f4c61726176656c2d41646d696e4c54452e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jeroennoten/Laravel-AdminLTE)[![Quality Score](https://camo.githubusercontent.com/e9c90cda6951e1769497bccf346b8c777cf9053a7a25527a404d946955ecc034/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6a65726f656e6e6f74656e2f4c61726176656c2d41646d696e4c54452e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/jeroennoten/Laravel-AdminLTE)[![StyleCI](https://camo.githubusercontent.com/65cbe856bc67e4e3a95b92b7ba30c54c850d818545d18d3d60ac7b497848a196/68747470733a2f2f7374796c6563692e696f2f7265706f732f33383230303433332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/38200433)[![Total Downloads](https://camo.githubusercontent.com/51de72e05eef4774511f0b7456922a15a2992a871a542960cb8ebed05480a585/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a65726f656e6e6f74656e2f4c61726176656c2d41646d696e4c54452e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeroennoten/Laravel-AdminLTE)

This package provides an easy way to quickly set up [AdminLTE v3](https://adminlte.io) with Laravel 6. It has no requirements and dependencies besides Laravel, so you can start building your admin panel immediately. The package just provides a Blade template that you can extend and advanced menu configuration possibilities. A replacement for the `make:auth` Artisan command that uses AdminLTE styled views instead of the default Laravel ones is also included.

If you want use the older versions, please use the following versions:

- Version 1.x or branch laravel5-adminlte2: This version supports Laravel 5 and included AdminLTE v2
- Version 2.x or branch laravel6-adminlte2: This version supports Laravel 6 and included AdminLTE v2

1. [Requirements](#1-requirements)
2. [Installation](#2-installation)
3. [Updating](#3-updating)
4. [Usage](#4-usage)
5. [Artisan Console Commands](#5-artisan-console-commands)
    1. [The `adminlte:install` Command](#51-the-adminlteinstall-command)
        1. [Options](#511-options)
    2. [The `adminlte:plugins` Command](#52-the-adminlteplugins-command)
    3. [The `adminlte:update` Command](#53-the-adminlteupdate-command)
    4. [Authentication views](#54-authentication-views)
        1. [Using the authentication views without the `adminlte:install` command](#541-using-the-authentication-views-without-the-adminlteinstall-command)
6. [Configuration](#6-configuration)
    1. [Title](#61-title)
    2. [Favicon](#62-favicon)
    3. [Logo](#63-logo)
    4. [Layout](#64-layout)
    5. [Classes](#65-classes)
    6. [Sidebar](#66-sidebar)
    7. [Control Sidebar (Right Sidebar)](#67-control-sidebar-right-sidebar)
    8. [URLs](#68-urls)
    9. [Laravel Mix](#69-laravel-mix)
    10. [Menu](#610-menu)
    11. [Adding a Search Input](#6101-adding-a-search-input)
    12. [Custom Menu Filters](#6102-custom-menu-filters)
    13. [Menu configuration at runtime](#6103-menu-configuration-at-runtime)
    14. [Active menu items](#6104-active-menu-items)
    15. [Menu Filters](#611-menu-filters)
    16. [Plugins](#612-plugins)
    17. [Pace Plugin Configuration](#6121-pace-plugin-configuration)
7. [Translations](#7-translations)
    1. [Menu Translations](#71-menu-translations)
8. [Customize views](#8-customize-views)
9. [Issues, Questions and Pull Requests](#9-issues-questions-and-pull-requests)

1. Requirements
---------------

[](#1-requirements)

- Laravel 6.x
- PHP &gt;= 7.2

2. Installation
---------------

[](#2-installation)

1. Require the package using composer:

    ```
    composer require hsyir/laravel-adminlte

    ```
2. Install the package using the command (For fresh laravel installations):

    ```
    php artisan adminlte:install

    ```

> You can use --basic to avoid authentication scaffolding installation
>
> You can use --force to overwrite any file
>
> You can also use --interactive to be guided through the process and choose what you want to install

3. Updating
-----------

[](#3-updating)

1. To update this package, first update the composer package:

    ```
    composer update hsyir/laravel-adminlte

    ```
2. Then, we need to update the assets

    > If you using AdminLTE for Laravel 5.x and are upgrading Laravel 6 version, delete the folder adminlte inside your public/vendor folder.

    And then use this command to publish new assets

    ```
    php artisan adminlte:update

    ```
3. If you have [published](#8-customize-views) and modified the default master, page views or login views, you will need to update them too.

    Option 1:

    - Make a copy of the views you modified.
    - Publish the views again, using ```
        php artisan vendor:publish --provider="JeroenNoten\LaravelAdminLte\AdminLteServiceProvider" --tag=views

        ```
    - Redo the modifications you did.

    Option 2:

    - Modify in the css, js and other assets location in the master and page views.

4. Usage
--------

[](#4-usage)

To use the template, create a blade file and extend the layout with `@extends('adminlte::page')`. This template yields the following sections:

- `title`: for in the `` tag
- `content_header`: title of the page, above the content
- `content`: all of the page's content
- `css`: extra stylesheets (located in ``)
- `js`: extra javascript (just before ``)

All sections are in fact optional. Your blade template could look like the following.

```
{{-- resources/views/admin/dashboard.blade.php --}}

@extends('adminlte::page')

@section('title', 'Dashboard')

@section('content_header')
    Dashboard
@stop

@section('content')
    Welcome to this beautiful admin panel.
@stop

@section('css')

@stop

@section('js')
     console.log('Hi!');
@stop
```

You now just return this view from your controller, as usual. Check out [AdminLTE](https://almsaeedstudio.com) to find out how to build beautiful content for your admin panel.

5. Artisan Console Commands
---------------------------

[](#5-artisan-console-commands)

### 5.1 The `adminlte:install` Command

[](#51-the-adminlteinstall-command)

You can install all required &amp; additional resources with the `adminlte:install` command.

Without any option it will install AdminLTE assets, config &amp; translations. You can also install the Authentication Views with adding `--type=enhanced` or additional to the Authentication Views also the Basic Views &amp; Routes with adding `--type=full` to the `adminlte:install` command.

#### 5.1.1 Options

[](#511-options)

- `--force`: Overwrite existing views by default
- `--type=`: Installation type, Available type: none, basic, enhanced &amp; full.
- `--only=`: Install only specific part, Available parts: assets, config, translations, auth\_views, basic\_views, basic\_routes &amp; main\_views. This option can not used with the with option.
- `--with=*`: Install basic assets with specific parts, Available parts: auth\_views, basic\_views &amp; basic\_routes. Can be use multiple
- `--interactive` : The installation will guide you through the process

### 5.2 The `adminlte:plugins` Command

[](#52-the-adminlteplugins-command)

If you won't use cdn for the plugins, you can manage the optional plugins assets with the `adminlte:plugins` command.

You can list all available plugins, install/update/remove all or specific plugins. Here are some examples for the command:

Install all plugin assets

- `artisan adminlte:plugins install`Install only Pace Progress &amp; Select2 plugin assets
- `artisan adminlte:plugins install --plugin=paceProgress --plugin=select2`

Update all Plugin assets

- `artisan adminlte:plugins update`Update only Pace Progress plugin assets
- `artisan adminlte:plugins update`

Remove all Plugin assets

- `artisan adminlte:plugins remove`Remove only Select2 plugin assets
- `artisan adminlte:plugins remove --plugin=select2`

#### 5.2.1 Options

[](#521-options)

- `operation`: Operation command, Available commands; list (default), install, update &amp; remove.
- `--plugin=`: Plugin Key. (Can used multiple times for the desired)
- `--interactive`: The installation will guide you through the process.

### 5.3 The `adminlte:update` Command

[](#53-the-adminlteupdate-command)

This command is only a shortcut for `adminlte:install --force --only=assets`.

### 5.4 Authentication views

[](#54-authentication-views)

> Note: only for Laravel 5.2 and higher

This package ships the following command to replaces the authentication views with AdminLTE style views.

```
php artisan adminlte:install --only=auth_views

```

### 5.4.1 Using the authentication views without the `adminlte:install` command

[](#541-using-the-authentication-views-without-the-adminlteinstall-command)

If you want to use the included authentication related views manually, you can create the following files and only add one line to each file:

- `resources/views/auth/login.blade.php`:

```
@extends('adminlte::login')

```

- `resources/views/auth/register.blade.php`

```
@extends('adminlte::register')

```

- `resources/views/auth/passwords/email.blade.php`

```
@extends('adminlte::passwords.email')

```

- `resources/views/auth/passwords/reset.blade.php`

```
@extends('adminlte::passwords.reset')

```

By default, the login form contains a link to the registration form. If you don't want a registration form, set the `register_url` setting to `null` and the link will not be displayed.

6. Configuration
----------------

[](#6-configuration)

First, publish the configuration file:

```
php artisan adminlte:install --only=config

```

Now, edit `config/adminlte.php` to configure the title, skin, menu, URLs etc. All configuration options are explained in the comments. However, I want to shed some light on the `menu` configuration.

### 6.1 Title

[](#61-title)

The default title of your admin panel, this goes into the title tag of your page. You can override it per page with the title section. You can optionally also specify a title prefix and/or postfix.

The following config options available:

- **`title`**

    Default title
- **`title_prefix`**

    Title prefix
- **`title_postfix`**

    Title postfix

### 6.2 Favicon

[](#62-favicon)

Favicons could be used easily. There are two different ways to do this. Please add all favicons in the dir public/favicons/.

- **`['use_ico_only' => true, 'use_full_favicon' => false]`**

    If set to `true`, the file `public/favicons/favicon.ico` is used.
- **`['use_ico_only' => false, 'use_full_favicon' => true]`**

If `'use_full_favicon' => true` more favicon files in `public/favicons/` will be used. The activated code is:

```

```

### 6.3 Logo

[](#63-logo)

The logo is displayed at the upper left corner of your admin panel. You can use basic HTML here if you want for a simple text logo with a small image logo (e.g. 50 x 50 pixels), or you can use two images one big (e.g. 210 x 33 pixels) and one small (e.g. 50 x 50 pixels). You can also change the sizes of the images and the alt text for both logos.

- **`logo`**

    Text logo content, can be HTML.
- **`logo_img`**

    Small logo image, beside text logo.

    *Recommend size: 50x50px*
- **`logo_img_class`**

    Extra classes for small logo image.
- **`logo_img_xl`**

    Large logo image, if you set a img url it will replace the text logo &amp; small logo with one big logo and on collapsed sidebar it displays the small logo.

    *Recommend size: 210x33px*
- **`logo_img_xl_class`**

    Extra classes for small logo image.
- **`logo_img_alt`**

    Logo image alt text.

### 6.4 Layout

[](#64-layout)

It's possible change the layout, you can use a top navigation (navbar) only layout, a boxed layout with sidebar and you can enable fixed mode for sidebar, navbar and footer.

The following config options available:

- **`layout_topnav`**

    Enables/Disables top navigation only layout.
- **`layout_boxed`**

    Enables/Disables Enables/Disables boxed layout, can't used with `layout_topnav`.
- **`layout_fixed_sidebar`**

    Enables/Disables fixed sidebar, can't used with `layout_topnav`.
- **`layout_fixed_navbar`**

    Enables/Disables fixed navbar (top navigation), here you can set `true` or pass an array for responsive usage.
- **`layout_fixed_footer`**

    Enables/Disables fixed footer, here you can set `true` or pass an array for responsive usage.

**Responsive Usage for `layout_fixed_navbar` &amp; `layout_fixed_footer`**

With responsive you can disable or enable the fixed navbar/footer for specific viewport sizes.

The array the following keys available, you can set them to `true` or `false`:

- `xs` from 0px to 575.99px
- `sm` from 576px to 767.99px
- `md` from 768px to 991.99px
- `lg` from 992px to 1199.99px
- `xl` from 1200px

**Examples**

- `['xs' => true, 'lg' => false]`

    Fixed from mobile to small tablet (&lt;= 991.99px)
- `['lg' => true]`

    Fixed starting from desktop (&gt;= 992px)
- `['xs' => true, 'md' => false, 'xl' => true]`

    Fixed from mobile (&lt;= 767.99px) and extra large desktops (&gt;= 1200px) but not for small tablet and desktop (&gt;= 768px &amp; &lt;= 1199.99px)

### 6.5 Classes

[](#65-classes)

You can change the look and behavior of the admin panel, you can add extra classes to body, brand, sidebar, sidebar navigation, top navigation and top navigation container.

The following config options available:

- **`classes_body`**

    Extra classes for body.
- **`classes_brand`**

    Extra classes for brand.
- **`classes_brand_text`**

    Extra classes for brand text.
- **`classes_content_header`**

    Extra classes for content header container.
- **`classes_content`**

    Extra classes for content container.
- **`classes_sidebar`**

    Extra classes for sidebar.
- **`classes_sidebar_nav`**

    Extra classes for sidebar navigation.
- **`classes_topnav`**

    Extra classes for top navigation bar.
- **`classes_topnav_nav`**

    Extra classes for top navigation.
- **`classes_topnav_container`**

    Extra classes for top navigation bar container.

### 6.6 Sidebar

[](#66-sidebar)

You can modify the sidebar, you can disable the collapsed mini sidebar, start with collapsed sidebar, enable sidebar auto collapse on specific screen size, enable sidebar collapse remember, change the scrollbar theme or auto hide option, disable sidebar navigation accordion and sidebar navigation menu item animation speed.

The following config options available:

- **`sidebar_mini`**

    Enables/Disables the collapsed mini sidebar for desktop and bigger screens (&gt;= 992px), here you can set `true`, `false` or `'md'` to enable for small tablet and bigger screens (&gt;= 768px).
- **`sidebar_collapse`**

    Enables/Disables collapsed by default.
- **`sidebar_collapse_auto_size`**

    Enables/Disables auto collapse by setting min width to collapse.
- **`sidebar_collapse_remember`**

    Enables/Disables collapse remeber script.
- **`sidebar_collapse_remember_no_transition`**

    Enables/Disables transition after reload page.
- **`sidebar_scrollbar_theme`**

    Changes sidebar scrollbar theme.
- **`sidebar_scrollbar_auto_hide`**

    Changes sidebar scrollbar auto hide trigger.
- **`sidebar_nav_accordion`**

    Enables/Disables sidebar navigation accordion feature.
- **`sidebar_nav_animation_speed`**

    Changes the sidebar navigation slide animation speed.

### 6.7 Control Sidebar (Right Sidebar)

[](#67-control-sidebar-right-sidebar)

Here you have the option to enable a right sidebar. When active, you can use @section('right-sidebar') The icon you configured will be displayed at the end of the top menu, and will show/hide the sidebar. The slide option will slide the sidebar over the content, while false will push the content, and have no animation. You can also choose the sidebar theme (dark or light).

The following config options available:

- **`right_sidebar`**

    Enables/Disables the right sidebar.
- **`right_sidebar_icon`**

    Changes the icon for the right sidebar button in main navigation.
- **`right_sidebar_theme`**

    Changes the theme of the right sidebar, the following options available: `dark` &amp; `light`.
- **`right_sidebar_slide`**

    Enables/Disables slide animation.
- **`right_sidebar_push`**

    Enables/Disables push content instead of overlay for right sidebar.
- **`right_sidebar_scrollbar_theme`**

    Enables/Disables transition after reload page.
- **`right_sidebar_scrollbar_auto_hide`**

    Changes sidebar scrollbar auto hide trigger.

### 6.8 URLs

[](#68-urls)

Here we have the url settings to setup the correct login/register link. Register here your dashboard, logout, login and register URLs.

- **`use_route_url`**

    Whether to use `route()` instead of `url()`.
- **`dashboard_url`**

    Changes the dashboard/logo URL.
- **`logout_url`**

    Changes the logout button URL.
- **`logout_method`**

    Changes the logout send method, available options: `GET`, `POST` &amp; `null` (Laravel default). The logout URL automatically sends a POST request in Laravel 5.3 or higher.
- **`login_url`**

    Changes the login url.
- **`register_url`**

    Changes the register link or if set `false` it will hide.
- **`password_reset_url`**

    Changes the password reset url.
- **`password_email_url`**

    Changes the password email url.

### 6.9 Laravel Mix

[](#69-laravel-mix)

If you want to use Laravel Mix instead of publishing the assets in your `/public/vendor` folder, start by installing the following NPM packages:

```
npm i @fortawesome/fontawesome-free
npm i icheck-bootstrap
npm i overlayscrollbars

```

Add the following to your `bootstrap.js` file after `window.$ = window.jQuery = require('jquery');`:

```
    require('overlayscrollbars');
    require('../../vendor/almasaeed2010/adminlte/dist/js/adminlte');

```

Replace your `app.scss` content by the following:

```
// Fonts
@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic');
@import '~@fortawesome/fontawesome-free/css/all.css';
// OverlayScrollbars
@import '~overlayscrollbars/css/OverlayScrollbars.css';
// iCheck
@import '~icheck-bootstrap/icheck-bootstrap.css';
// AdminLTE
@import '../../vendor/almasaeed2010/adminlte/dist/css/adminlte.css';
// Bootstrap
// Already imported by AdminLTE
//@import '~bootstrap/scss/bootstrap';

```

After preparing the Laravel Mix vendor files, set `enabled_laravel_mix` to `true` to enable load app.css &amp; app.js .

- **`enabled_laravel_mix`**

    Enables Laravel Mix specific css/js load in master layout. **Warning** If you enable this option, the sections `adminlte_css` &amp; `adminlte_js` will not rendered.

### 6.10 Menu

[](#610-menu)

Specify your menu items to display in the left sidebar. Each menu item should have a text and a URL. You can also specify an icon from Font Awesome. A string instead of an array represents a header in sidebar layout. The 'can' is a filter on Laravel's built in Gate functionality.

You can configure your menu as follows:

```
'menu' => [
    'MAIN NAVIGATION',
    [
        'text' => 'Blog',
        'url' => 'admin/blog',
    ],
    [
        'text' => 'Pages',
        'url' => 'admin/pages',
        'icon' => 'fas fa-fw fa-file'
    ],
    [
        'text' => 'Show my website',
        'url' => '/',
        'target' => '_blank'
    ],
    'ACCOUNT SETTINGS',
    [
        'text' => 'Profile',
        'route' => 'admin.profile',
        'icon' => 'fas fa-fw fa-user'
    ],
    [
        'text' => 'Change Password',
        'route' => 'admin.password',
        'icon' => 'fas fa-fw fa-lock'
    ],
],
```

With a single string, you specify a menu header item to separate the items. With an array, you specify a menu item. `text` and `url` or `route` are required attributes. The `icon` attribute is optional, you get an [open circle](https://fontawesome.com/icons/circle?style=regular&from=io) if you leave it out. The available icons that you can use are those from [Font Awesome](https://fontawesome.io/icons/). Just specify the name of the icon and it will appear in front of your menu item.

It's also possible to add menu items to the top navigation while sidebar is enabled, you just need to set the `topnav` attribute to `true`. This will ignored if the top navigation layout is enabled, all menu items will appear in top navigation.

Use the `can` attribute if you want conditionally show the menu item. This integrates with Laravel's `Gate` functionality. If you need to conditionally show headers as well, you need to wrap it in an array like other menu items, using the `header` attribute:

```
[
    [
        'header' => 'BLOG',
        'url' => 'admin/blog',
        'can' => 'manage-blog'
    ],
    [
        'text' => 'Add new post',
        'url' => 'admin/blog/new',
        'can' => 'add-blog-post'
    ],
]
```

#### 6.10.1 Adding a Search Input

[](#6101-adding-a-search-input)

It's possible to add a search input in your menu, using a menu item with the following configuration:

```
        [
            'search' => true,
            'href' => 'test',  //form action
            'method' => 'POST', //form method
            'input_name' => 'menu-search-input', //input name
            'text' => 'Search', //input placeholder
        ],
```

#### 6.10.2 Custom Menu Filters

[](#6102-custom-menu-filters)

If you need custom filters, you can easily add your own menu filters to this package. This can be useful when you are using a third-party package for authorization (instead of Laravel's `Gate` functionality).

For example with Laratrust:

```
