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.
- Backend theme Admin LTE
- Css framework Bootstrap 3
- Additional icons by Font Awesome
- Role-based permissions provided by santigarcor/laratrust
- Forms & Html helpers by laravelcollective/html
- Menu dynamically builded by lavary/laravel-menu
- Menu items activated by hieu-le/active
- Server-sided datatables methods provided by yajra/laravel-datatables
- Multi-language date support by jenssegers/date
- Image manipulation by intervention/image
- Localized English-French
For other version : 5.4
- In order to install Laravel/AdminLTE Boilerplate run :
composer require sebastienheyd/boilerplate
- Run the command below to publish assets, views, lang files, ... select
Provider: Sebastienheyd\Boilerplate\BoilerplateServiceProvider
php artisan vendor:publish
- 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.
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
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 ofconfig/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.
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.
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 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 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
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 :
boilerplate::load.datatables
: Datatables - Exampleboilerplate::load.datepicker
: Datepicker & DateRangePicker - Exampleboilerplate::load.icheck
: iCheck - Exampleboilerplate::load.select2
: Select2 - Exampleboilerplate::load.moment
: MomentJsboilerplate::load.fileinput
: Bootstrap FileInput
More will come...
Some plugins are loaded by default :
You can see examples on the default dashboard.
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
).
This package is free software distributed under the terms of the MIT license.