Skip to content

Laravel ≥ 5.4 - AdminLTE Boilerplate with user, roles and permissions management

License

Notifications You must be signed in to change notification settings

jomarsilio/boilerplate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Laravel/AdminLTE Boilerplate

Package Laravel Packagist MIT License

This package is to be served as a basis for a web application. It allows you to access to an administration panel to manage users, roles and permissions.

Features

Installation

For other version : 5.4

  1. In order to install Laravel/AdminLTE Boilerplate run :
composer require sebastienheyd/boilerplate
  1. Run the command below to publish assets, views, lang files, ... select Provider: Sebastienheyd\Boilerplate\BoilerplateServiceProvider
php artisan vendor:publish
  1. After you set your database parameters in your .env file run :
php artisan migrate

Optional

If you want to quickly test your Laravel application.

php artisan serve

Now you can point your browser to http://localhost:8000/ you will see buttons on the top right of the Laravel's default page. Click on Login or Register to access the administration panel.

Update

Boilerplate comes with assets such as Javascript, CSS, and images. Since you typically will need to overwrite the assets every time the package is updated, you may use the --force flag. For example :

php artisan vendor:publish --tag=public --force

If needed, you can force update for these tags : config, routes, resources, public, models, notifications, webpack

Configuration

After php artisan vendor:publish you will find a folder boilerplate into the directory config.

  • app.php : name of the application (only backend), admin panel prefix and redirection after login (see comments in file)
  • auth.php : overriding of config/auth.php to use boilerplate's models instead of default Laravel's models. Allow you to define if users can register from login page and which role will be assigned to a new user.
  • laratrust.php : overriding of Laratrust's (package santigarcor/laratrust) default config.
  • menu.php : classes to add menu items, see below.

Adding items to the main menu

If in your application you need to add items to the main menu, you must declare the classes you want to use to build your menu into the config file menu.php.

As you can see you have already two classes declared into this file, if you check the code into Users.php or Logs.php you will find a method named make(Builder $menu). This is the method called to build menu items. Feel free to use these files as an example to build your own menu items.

So, to add menu items : create a class, declare this class into the config file menu.php and add a make(Builder $menu) method into the class.

Don't forget to declare use Sebastienheyd\Boilerplate\Menu\Builder as Builder;

See lavary/laravel-menu and hieu-le/active documentations.

Customizing views

When published by php artisan vendor:publish views are copied to the folder resources/views/vendor/boilerplate.

Error views are copied to the folder resources/views/errors

Every view into these folders can be modified, they will not be overwrited if you launch php artisan vendor:publish again. You can already delete these files to reset them if needed, just remove them and run php artisan vendor:publish

Routes

Routes are loaded from the file boilerplate.php. After php artisan vendor:publish the file will be found in the folder routes at the root of your project.

A default prefix admin is set into the config file app.php, this is why boilerplate is accessible by /admin url. You can set an empty prefix if you remove the default route / defined in routes/web.php

Language

Language used by boilerplate is the application language declared into config/app.php. For the moment only english and french are supported.

When you run php artisan vendor:publish, locale files are copied to the folder resources/lang/vendor/boilerplate

NB : Dates are translated by the package jenssegers/date

Loading plugins assets

By default, only jQuery, bootstrap 3, Font Awesome and AdminLTE scripts and css are loaded.

To "activate" and use plugins like datatable, datepicker, icheck, ... you can use "loaders". These are blade templates prepared to add the loading of scripts and styles for a plugin.

For example, you want to use a datepicker on a text field :

@include('boilerplate::load.datepicker')
@push('js')
    <script>
        $('.daterangepicker').daterangepicker();
        $('.datepicker').datepicker();
    </script>
@endpush

Here @include('boilerplate::load.datepicker') will load scripts and styles to allow usage of datepicker. After that you can push your scripts on the js stack (or styles on the css stack).

Available loaders are :

More will come...

Some plugins are loaded by default :

You can see examples on the default dashboard.

Updating assets

Boilerplate come with compiled assets. To do this, this package is frequently updated by using npm and mix.

If you need to update assets by yourself, remove the file webpack.mix.js at the root of your Laravel project and do a php artisan vendor:publish. The file from this package will be automatically copied to this location.

You can already replace by yourself the file with the file webpack.mix.js from this package.

After that, at the root of your project, run npm update and npm run dev (or npm run production).

See Laravel Mix documentation

License

This package is free software distributed under the terms of the MIT license.

About

Laravel ≥ 5.4 - AdminLTE Boilerplate with user, roles and permissions management

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 62.7%
  • HTML 29.7%
  • CSS 6.5%
  • PHP 1.1%