-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Usage
To use the blade template provided by this package, just create a new blade file and extend the layout with @extends('adminlte::page')
. The template yields the following main sections:
-
title
: to fill the content of the<title>
tag. -
content_header
: to fill the title of the page (above the main content). -
content
: to fill all of the page's main content. -
footer
: to fill the content of the page footer. -
right-sidebar
: to fill the content of the right (control) sidebar. -
css
: to add extra stylesheets (inside the<head>
tag). -
js
: to add extra javascript (just before the</body>
tag).
In fact, all the mentioned sections are optional. As a basic example, your most common blade template could look like the following one:
@extends('adminlte::page')
@section('title', 'Dashboard')
@section('content_header')
<h1>Dashboard</h1>
@stop
@section('content')
<p>Welcome to this beautiful admin panel.</p>
@stop
@section('css')
<link rel="stylesheet" href="/css/admin_custom.css">
@stop
@section('js')
<script> console.log('Hi!'); </script>
@stop
Now, and as usual, you just return this view from a controller. It is a recommendation to check out AdminLTE v3 to find out how to build beautiful content for your admin panel. As a preview, the next image shows what you can get with the previous blade template:
Note: On a fresh Laravel installation, and after installing this package, you can replace the
resources/views/welcome.blade.php
file with the previous code for a fast template review.
Also, this package offers default templates for login and register pages which can be used with @extends('adminlte::auth.login')
and @extends('adminlte::auth.register')
. Read the Authentication Views for more details.
Home | Installation | Updating | Usage | Basic Config | Layout Config | Menu Config | Plugins Config | Blade X-Components - Laravel-AdminTE