npmweb/admin-theme-laravel-layout

This package is abandoned and no longer maintained. No replacement package was suggested.

Layout files to use in Laravel with the NPM Admin Theme look and feel.

3.0.0 2015-09-16 13:40 UTC

This package is not auto-updated.

Last update: 2017-03-16 10:22:16 UTC


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 a public/css/app.css file. (You can copy this package's src/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 of admin-theme) needs to be copied to public/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 of app.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.