npmweb / admin-theme-laravel-layout
Layout files to use in Laravel with the NPM Admin Theme look and feel.
Installs: 2 094
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 12
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.0
- illuminate/support: ~4.2 || ~5.0
- laracasts/flash: ~1.3
- laravelcollective/html: ~4.2 || ~5.0
- npmweb/laravel-helpers: 1.*
README
Layout files to use in Laravel with the NPM Admin Theme look and feel.
Works with the npmweb/admin-theme Bower package.
Installation
Run composer require npmweb/admin-theme-laravel-layout:^3.0
Add the service provider to your Laravel service providers list in config\app.php
:
'providers' => [
...
NpmWeb\AdminThemeLaravelLayout\LayoutServiceProvider::class,
],
This package also relies on laravelcollective/html
. It's pulled down by Composer, but if you don't already have it set up in your app.php
, add the following entries:
'providers' => [
...
Collective\Html\HtmlServiceProvider::class,
],
...
'aliases' => [
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
],
Add an empty public/css/makeitbetter.css
file. This is this package's name for shame.css.
Install the Admin Theme sass library npmweb/admin-theme (i.e. by using Bower). Then set up the default JS and CSS assets required with Elixir. All of these can be handled by replacing your Laravel project's gulpfile.js with the sample src/gulpfile.js
.
- Sass or Less is compiled from
resources/assets/sass/app.scss
down into apublic/css/app.css
file. (You can copy this package'ssrc/app.scss
to get started.) - Third-party JavaScript dependencies are combined into a
public/js/vendor.js
file. - The
foundation-icon-fonts
library (downloaded by Bower as a dependency ofadmin-theme
) needs to be copied topublic/vendor/foundation-icon-fonts
to be web-accessible. - And all of those files need to be versioned using Elixir with
mix.version()
.
Add an entry to config/app.php
to set the name of the system that shows up in the template:
'name' => 'My Awesome App',
Usage
Instead of extending your own Blade layout template, use the following line:
@extends('admin-theme-laravel-layout::layout')
The following sections can be filled in using @section('my-section-name')
syntax:
'content'
: your main page body content'breadcrumbs'
: breadcrumbs that show up at the top of the page'page-header-buttons'
: buttons that show up to the right of the page header, i.e. to'js'
: page-specific <script/> tags'css'
: page-specific CSS <link/> tags
You can also override some view partials to customize appearance for your system. Just run php artisan vendor:publish --provider="NpmWeb\AdminThemeLaravelLayout\LayoutServiceProvider"
, then customize them in resources/views/vendor/admin-theme-laravel-layout
:
'_nav.blade.php'
: define your sidebar'css/_non_sass.blade.php
: any CSS files that can't be included in your Sass build ofapp.css
'scripts/_app.blade.php
: any app-specific JS files- any other view partials you like
When rendering a view, be sure to pass a 'page_title'
data item for the title to show for the page.
License
This code is open-sourced under the MIT license. For more information, see the LICENSE file.