Giter Club home page Giter Club logo

laravel-adminlte's Introduction

Easy AdminLTE integration with Laravel

Latest Packagist Version Total Downloads GitHub Checks Status Quality Score Code Coverage StyleCI

This package provides an easy way to quickly set up AdminLTE v3 with Laravel (7 or higher). It has no others requirements and dependencies besides Laravel, so you can start building your admin panel immediately. The package provides a blade template that you can extend and an advanced menu configuration system. Also, and optionally, the package offers a set of AdminLTE styled authentication views that you can use in replacement of the ones that are provided by the legacy laravel/ui authentication scaffolding.

If you want to use an older Laravel or AdminLTE version, review the following package releases:

  • Releases 1.x: These releases supports Laravel 5 and include AdminLTE v2
  • Releases 2.x: These releases supports Laravel 6 and include AdminLTE v2
  • Releases 3.x (<=3.8.6): These releases supports Laravel 6 and include AdminLTE v3

Documentation

All documentation is available on the Wiki Pages, we encourage you to read it. If you are new start with the Installation Guide. To update the package consult the Updating Guide.

Requirements

The current package requirements are:

  • Laravel >= 7.x
  • PHP >= 7.2.5

Issues, Questions and Pull Requests

You can report issues or ask questions in the issues section. Please, start your issue with [BUG] and your question with [QUESTION] in the subject.

You may also use the issues to propose changes for the Wiki Pages, in that case use [WIKI] at the beginning of the subject.

If you have a question, it is recommended to make a search over the closed issues first.

To submit a Pull Request, fork this repository and create a new branch to commit your new changes there. Finally, open a Pull Request from your new branch. Refer to the contribution guidelines for detailed instructions. When submitting a Pull Request take the next notes into consideration:

  • Verify that the Pull Request doesn't introduce a high downgrade on the code quality.
  • If the Pull Request adds a new feature, consider adding a proposal of the documentation for the Wiki.
  • Keep the package focused, don't add special support to other packages or to solve very particular situations. These changes will make the package harder to maintain.

laravel-adminlte's People

Contributors

adrienpoupa avatar adwiv avatar andcarpi avatar anpix avatar apisznasdin avatar ardakilic avatar armandsar avatar cliffordjames avatar crazyfreeman avatar dfsmania avatar epalmans avatar jeroennoten avatar jhdxr avatar koozza avatar luiztoni avatar lvkz avatar machadoug avatar masterbratac avatar rattone avatar rejack avatar resslinger avatar ruanpepe avatar schajee avatar shankhadevpadam avatar stenfrank avatar warquia avatar yasir91 avatar yiidiir avatar zcwilt avatar zhanang19 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-adminlte's Issues

Laravel 5.4 Support

Hello,

With the release of Laravel 5.4 now, would it be possible for you to look at supporting 5.4 too?

Thanks for your help!

Joel

Error

FatalErrorException in ServiceProvider.php line 100:
syntax error, unexpected '.'

Any idea about what am I doing wrong?

Error: the fixed layout requires the slimscroll plugin!

I'm a new bye guy with webpack and its stuffs.

I just want to know how to add this pligin via webpack or other way.

i'm using the fixed layout (changed in config/adminlte.php ) and now, i'm just trying to execute npm run dev and it is giving another error like "app.scss doesn't export content".

Could you help me explaing to me how to understand and solve problems arround webpack n'stuffs?

How to disable the default tree menu?

I had deleted the config/adminlte.php menu section, but the default menu still in the page, and I found that it is loading vendor/jeroennoten/laravel-adminlte/config/adminlte.php config file, how can I disable the default menu, and run only AppServiceProvider runtime menu? Thanks.

Logout is now a POST request

In Laravel 5.3, the logout route apparently responds to a POST request. I have no problems adding a GET request manually for this package, but the reasons why it was changed to a POST request seem logical.

Is there any way of changing the logout url into a POST request entirely? Or adding an option in the config to define if the logout route should respond to a GET or a POST request?

I've tried looking at it, but I'm afraid I don't know enough php/HTML/Laravel to do it.

capture

Undefined index: icon

After install

ErrorException in 9dcf61b8761ef39af9d88755df9f76b70b292f8d.php line 8:
Undefined index: icon (View: a/p/p/p/a/t/h/resources\views\vendor\adminlte\partials\menu-item.blade.php) (View: a/p/p/p/a/t/h/resources\views\vendor\adminlte\partials\menu-item.blade.php) (View: a/p/p/p/a/t/h/resources\views\vendor\adminlte\partials\menu-item.blade.php) (View: a/p/p/p/a/t/h/resources\views\vendor\adminlte\partials\menu-item.blade.php)

jQuery wrong case

In resources/views/master.blade.php line 29, I think it should be 'jquery-2.2.3.min.js' not 'jQuery-2.2.3.min.js' because the jquery file is resources/assets/plugins/jQuery/jquery-2.2.3.min.js with letter 'Q' in small case. I'm using linux and the jquery couldn't be loaded because linux is case-sensitive.

I'm sorry if my english is bad.

Menu active when using route()

Laravel (5.3) returns the full URL when using the route(...) helper function. The ActiveChecker class only checks for the path() section of the current route.

So when using 'url' => route(...) in the menu config the ActiveChecker never marks the menu item as active.

How to show count variable in menu ?

How to pass an variable in label for adminlte.php

'menu' => [ 'MAIN NAVIGATION', [ 'text' => 'Pages', 'url' => 'admin/pages', 'icon' => 'file', 'label' => count($all_pages) // How to pass variable here, 'label_color' => 'success', ], ];

Sidebar menu - do not collapse automatically

Hi,

The default functionality for the sidebar multi-level menus is to collapse automatically when another menu is clicked. Is it possible to keep multiple menus open and only close a menu if you click on that same menu again? What I have in mind is something like what's at the link below.

http://www.bootply.com/90JfjI2Q7n

Thanks for any help/suggestions you can provide.

fullcalender plugin

how to add fullcalendar plugin like the datatables?

'plugins' => [
    'datatables' => true,
]

Is it that I'll add the CDN here and include it in the adminlte.php, right?

master.php
@if(config('adminlte.plugins.datatables'))
        <!-- DataTables -->
        <link rel="stylesheet" href="//cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">
@endif

Create menu from database

Hi,

How can i create a menu from my database?
I am unable to recreate the config array using loops.

Is there a sample which could use?

Thanks in advance!

Laratrust

I'm using Laratrust and try implements:
I created these files

App\MyMenuFilter.php

<?php

namespace App;

use JeroenNoten\LaravelAdminLte\Menu\Builder;
use JeroenNoten\LaravelAdminLte\Menu\Filters\FilterInterface;

class MyMenuFilter implements FilterInterface
{
    public function transform($item, Builder $builder)
    {
        if (isset($item['permission']) && Laratrust::can($item['permission'])) {
            return false;
        }

        return $item;
    }
}

I changed this
config\adminlte.php

    'menu' => [
        'MAIN NAVIGATION',
        [
            'text' => 'Blog',
            'url'  => 'admin/blog',
            'permission'  => 'create-post', // Here
        ],
        #code
    ]

    'filters' => [
        #code
        //JeroenNoten\LaravelAdminLte\Menu\Filters\GateFilter::class,
        App\MyMenuFilter::class,
    ],

But show this error:
Class 'App\Laratrust' not found (View: /var/www/html/multi-auth/vendor/jeroennoten/laravel-adminlte/resources/views/page.blade.php)

Custom-Made page.blade.php

I found that I can duplicate the login.blade.php in views/vendor to loginadmin.blade.php and logincustomer.blade.php, and call it by using @extends('adminlte::pageadmin') and @extends('adminlte::pagecustomer'), but I want do the same thing with page.blade.php, it shows Undefined variable: adminlte, because I want to have different css color with different login role, how can I do that? Thank you!

Request for Menu

Hello,

Can we have the ability to use the Laratrust package with the menu to use permissions instead of just the Laravels Gate using can?

Example...

'menu' => [
    'MAIN NAVIGATION',
   /*[
            'text' => 'Blog',
            'url'  => 'admin/blog',
            //'can'  => 'manage-blog',
            'permission' => 'blog.*',
        ],*/
 ...
],

Skin colours

Hi, I really appreciate your work.
I'm trying to change the skin colours, but when I change and set 'skin' => 'purple' into my adminlte.php config file, it doesn't work. In fact, in my login page where i have your code: @extends('adminlte::login'), it remains the blue for the buttons and links, directly from AdminLTE.min.css.
Can you help me?

Thanks,

Antonio

Laravel 5.3 issue

When running the command php artisan make:adminlte the following error occurs

[ErrorException]
copy(/home/user/Projects/laravel/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/emails/password.stub): failed to open stream: No such file or directory

Using the laravel 5.3.x-dev 5cce34b

Routes missing?

Just a question, are the routes to change password or admin/pages created?
Or the menu is just a sample?
I just want to know if I did something wrong, or it's normal.

Compatibility with Laravel 5.1?

It seems that requires Laravel 5.2. It would be great if it has compatibility with Laravel 5.1 (because this is a LTS version).

Thanks!

Conditional header in menu

How can I add a condition to a menu header?

Example if i have:

'menu' => [
        'MAIN NAVIGATION',
        [
            'text' => 'Dashboard',
            'url'  => 'home',
            'icon' => 'dashboard',
        ],
        'ADMINISTRATION',
        [
            'text'       => 'Users',
            'url'        => 'admin/users',
            'has-role'   => 'admin',
        ],
        [
            'text'       => 'Roles',
            'url'        => 'admin/roles',
            'has-role'   => 'admin',
        ],
        [
            'text'       => 'Permissions',
            'url'        => 'admin/permissions',
            'has-role'   => 'admin',
        ],
        [
            'text'       => 'History',
            'url'        => 'admin/history',
            'has-role'   => 'admin',
        ],
    ],

How can I add a condition to the ADMINISTRATION header?

iCheck background images missing

With the standard installation the images for the iCheck checkboxes are in the public vendor folder but the reference in the css isn't correct.

image

Class App\Providers\Dispatcher does not exist

I follow the installation instruction for the "Menu configuration at runtime"

I got an error message, Class App\Providers\Dispatcher does not exist

How can I fix it?

I am using Laravel 5.1 and want to build a runtime menu. Thanks

Datatable

Hi,
I try to use datatable. So at the end of a .blade.php I add
`{{Html::script('https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js')}}

@section('scripts')
<script type="text/javascript">
$(function () {

        $('#ImportTable').DataTable({
            "paging": true,
            "lengthChange": false,
            "searching": false,
            "ordering": true,
            "info": true,
            "autoWidth": false
        });
    });


</script>

@Stop

@yield('scripts');
`

but I have this errors

ReferenceError: jQuery is not defined[En savoir plus] jquery.dataTables.min.js:5:124
https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js:5:124
https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js:5:2
ReferenceError: $ is not defined[En savoir plus] catalogue:7:9
http://localhost:8888/WineOS/public/catalogue:7:9

101/5000

This is probably related to the loading order of the scripts but I can not solve the problem.

Thank you for your help

config/adminlte.php not working

I tried to make some changes in the configuration file / adminlte.php
example:

    'menu' => [
        // CODE
        'MAIN NAVIGATION',
        [
            'text' => 'My Blog', // change name
            'url'  => 'admin/', // remove 'can' 
        ],
        // CODE
    ]

But when I update my page menu is not changed.

Hidden Header in menu

I changed the adminlte.php to display the item only with permission. But when the user does not permit it shows the header without options wanted to hide it well.

    'ROLES / PERMISSIONS', // want hidden this in my template.
    [
        'text' => 'Roles',
        'icon' => 'unlock-alt',
        'permission'  => 'approve', // if permission is deny
        'submenu' => [
            [
                'text' => 'All roles',
                'url'  => 'dashboard/roles',
            ],
            [
                'text' => 'New role',
                'url'  => 'dashboard/roles/create',
            ],
        ],
    ],

Laratrust

I'm using Laratrust and try implements:
I created these files

App\MyMenuFilter.php

<?php

namespace App;

use JeroenNoten\LaravelAdminLte\Menu\Builder;
use JeroenNoten\LaravelAdminLte\Menu\Filters\FilterInterface;

class MyMenuFilter implements FilterInterface
{
    public function transform($item, Builder $builder)
    {
        if (isset($item['permission']) && Laratrust::can($item['permission'])) {
            return false;
        }

        return $item;
    }
}

I changed this
config\adminlte.php

    'menu' => [
        'MAIN NAVIGATION',
        [
            'text' => 'Blog',
            'url'  => 'admin/blog',
            'permission'  => 'create-post', // Here
        ],
        #code
    ]

    'filters' => [
        #code
        //JeroenNoten\LaravelAdminLte\Menu\Filters\GateFilter::class,
        App\MyMenuFilter::class,
    ],

But show this error:
Class 'App\Laratrust' not found (View: /var/www/html/multi-auth/vendor/jeroennoten/laravel-adminlte/resources/views/page.blade.php)

Problem with route and save register in BD (form-adminlte)

Good I have a problem with the adminlte and the routes .. I create my controller, I create my route, I convert the url en route so that in the blade the form picks up the information to save in the database but when registration is not stored in The database has tried everything and I do not know what to do if someone please help me

blade.php:

{!! Form::open(['route' => 'UsersLogincontroller.store', 'method' => 'post', 'novalidate']) !!}

routes:

Route::post('users',['as'=> 'UsersLogincontroller.store', 'uses'=>'UsersLogincontroller@store ']);

PS: this same I did a form without the adminlte and I keep it lso perfectly register in the DB

Fatal error: Allowed memory size of 134217728 bytes exhausted

Hello, whenever I publish (or manually copy) the config file, I get this error if I try to php artisan serve or any other command.

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in D:\Sites\cobalt-site\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 549

Any ideas why?

Thank you for your package.

Cannot make menu dispatcher work

Hey once again :)

I've modified the default EventServiceProvider and added the proposed code into the boot method

    public function boot(DispatcherContract $events)
    {
        parent::boot($events);

        //
        $events->listen(\JeroenNoten\LaravelAdminLte\Events\BuildingMenu::class, function (BuildingMenu $event) {
            $event->menu->add('MAIN NAVIGATION');
            $event->menu->add([
                'text' => 'Blog',
                'url'  => 'admin/blog',
            ]);
        });
    }

But, when I visit the page, I get the following error

ErrorException in EventServiceProvider.php line 32:
Type error: Argument 1 passed to 
App\Providers\EventServiceProvider::App\Providers\{closure}() must be an instance of 
App\Providers\BuildingMenu,
 instance of JeroenNoten\LaravelAdminLte\Events\BuildingMenu given

Any ideas are appreciated
Thanks!

Different menus per route group

I was wondering, is there a more elegant way that we can set different menus based on route.
For example the admin group in the routes.php to have menu A and the user group to have menu B

Right now, what I've done is setting an empty menu in the config/adminlte.php and then in the routes.php, i'm creating the menu per group,

Route::group(['prefix' => 'admin'], function () {
    Route::get('dashboard', function () {

        Event::listen('JeroenNoten\LaravelAdminLte\Events\BuildingMenu', function ($event) {
            $event->menu->add('MAIN NAVIGATION');
            $event->menu->add([
                'text' => 'Blog',
                'url'  => 'admin/blog',
            ]);
        });

        return view('welcome');
    });
});

Sorry for all these questions, but I think that you have been through these issues before me, and it would be a pitty to recreate the wheel

Problem with Custom Filter

I noticed an issue with the custom filter syntax not being correct with the Laratrust module.

<?php

namespace MyApp;

use JeroenNoten\LaravelAdminLte\Menu\Builder;
use JeroenNoten\LaravelAdminLte\Menu\Filters\FilterInterface;
use Laratrust;

class MyMenuFilter implements FilterInterface
{
    public function transform($item, Builder $builder)
    {
        if (isset($item['permission'] && Laratrust::can($item['permission'])) {
            return false;
        }

        if (isset($item['header'])) {
            $item = $item['header'];
        }

        return $item;
    }
}

needs to be

<?php

namespace MyApp;

use JeroenNoten\LaravelAdminLte\Menu\Builder;
use JeroenNoten\LaravelAdminLte\Menu\Filters\FilterInterface;
use Laratrust;

class MyMenuFilter implements FilterInterface
{
    public function transform($item, Builder $builder)
    {
        if (isset($item['permission']) && !Laratrust::can($item['permission'])) {
            return false;
        }

        if (isset($item['header'])) {
            $item = $item['header'];
        }

        return $item;
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.