PHPackages                             acharsoft/laravel-adminlte-rtl - 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. acharsoft/laravel-adminlte-rtl

ActiveLibrary[Admin Panels](/categories/admin)

acharsoft/laravel-adminlte-rtl
==============================

Easy AdminLTE integration with Laravel with rtl support

v2.1.1(7y ago)61995[1 issues](https://github.com/acharsoft/Laravel-AdminLTE-RTL/issues)MITJavaScriptPHP &gt;=7.0

Since Jan 26Pushed 7y agoCompare

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

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

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

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

[![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](https://almsaeedstudio.com) with Laravel 5. 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.

1. [Installation](#1-installation)
2. [Updating](#2-updating)
3. [Usage](#3-usage)
4. [The `make:adminlte` artisan command](#4-the-makeadminlte-artisan-command)
    1. [Using the authentication views without the `make:adminlte` command](#41-using-the-authentication-views-without-the-makeadminlte-command)
5. [Configuration](#5-configuration)
    1. [Menu](#51-menu)

    - [Custom menu filters](#custom-menu-filters)
    - [Menu configuration at runtime](#menu-configuration-at-runtime)
    - [Active menu items](#active-menu-items)

    2. [Plugins](#52-plugins)
6. [Translations](#6-translations)
7. [Customize views](#7-customize-views)
8. [Issues, Questions and Pull Requests](#8-issues-questions-and-pull-requests)

1. Installation
---------------

[](#1-installation)

1. Require the package using composer:

    ```
    composer require acharsoft/laravel-adminlte-rtl

    ```
2. Add the service provider to the `providers` in `config/app.php`:

    > Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider

    ```
    acharsoft\LaravelAdminLte\ServiceProvider::class,
    ```
3. Publish the public assets:

    ```
    php artisan vendor:publish --provider="acharsoft\LaravelAdminLte\ServiceProvider" --tag=assets

    ```

2. Updating
-----------

[](#2-updating)

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

    ```
    composer update acharsoft/laravel-adminlte-rtl

    ```
2. Then, publish the public assets with the `--force` flag to overwrite existing files

    ```
    php artisan vendor:publish --provider="acharsoft\LaravelAdminLte\ServiceProvider" --tag=assets --force

    ```

3. Usage
--------

[](#3-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
```

Note that in Laravel 5.2 or higher you can also use `@stack` directive for `css` and `javascript`:

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

@push('css')

@push('js')
```

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.

4. The `make:adminlte` artisan command
--------------------------------------

[](#4-the-makeadminlte-artisan-command)

> Note: only for Laravel 5.2 and higher

This package ships with a `make:adminlte` command that behaves exactly like `make:auth` (introduced in Laravel 5.2) but replaces the authentication views with AdminLTE style views.

```
php artisan make:adminlte

```

This command should be used on fresh applications, just like the `make:auth` command

### 4.1 Using the authentication views without the `make:adminlte` command

[](#41-using-the-authentication-views-without-the-makeadminlte-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.

5. Configuration
----------------

[](#5-configuration)

First, publish the configuration file:

```
php artisan vendor:publish --provider="acharsoft\LaravelAdminLte\ServiceProvider" --tag=config

```

```
php artisan vendor:publish --provider="Yadahan\AuthenticationLog\AuthenticationLogServiceProvider"

```

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.

### 5.0 Migrations

[](#50-migrations)

First, publish the migration file:

```
php artisan vendor:publish --provider="acharsoft\LaravelAdminLte\ServiceProvider" --tag=migrations

```

Now, you run this command.

```
php artisan migrate

```

Finally, add the `AuthenticationLogable` and `Notifiable` traits to your authenticatable model (by default, `App\User` model). These traits provides various methods to allow you to get common authentication log data, such as last login time, last login IP address, and set the channels to notify the user when login from a new device:

```
use Illuminate\Notifications\Notifiable;
use Yadahan\AuthenticationLog\AuthenticationLogable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable, AuthenticationLogable;
}
```

### 5.1 Menu

[](#51-menu)

You can configure your menu as follows:

```
'menu' => [
    'MAIN NAVIGATION',
    [
        'text' => 'Blog',
        'url' => 'admin/blog',
    ],
    [
        'text' => 'Pages',
        'url' => 'admin/pages',
        'icon' => 'file'
    ],
    [
        'text' => 'Show my website',
        'url' => '/',
        'target' => '_blank'
    ],
    'ACCOUNT SETTINGS',
    [
        'text' => 'Profile',
        'route' => 'admin.profile',
        'icon' => 'user'
    ],
    [
        'text' => 'Change Password',
        'route' => 'admin.password',
        'icon' => '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` is optional, you get an [open circle](http://fontawesome.io/icon/circle-o/) if you leave it out. The available icons that you can use are those from [Font Awesome](http://fontawesome.io/icons/). Just specify the name of the icon and it will appear in front of your menu item.

Use the `can` option 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` option:

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

Use the `permission` option if you want conditionally show the menu item. If you need to conditionally show headers as well, you need to wrap it in an array like other menu items, using the `header` option:

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

#### Custom Menu Filters

[](#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:

```
