Laravel 6 integrate AdminLte admin theme jeroennoten

Laravel 6 integrate AdminLte admin theme jeroennoten

We are going to learn Laravel 6 integrate AdminLte Bootstrap Admin theme to Laravel. I found the best Jeroennoten Laravel AdminLTE package using that we can easily integrate the AdminLTE admin theme. Every developer doesn’t have a good knowledge of designing. So, the AdminLTE Bootstrap admin theme really helpful to startup the admin panel instead of design it from scratch. AdminLTE is popular and open source admin template.

Laravel 6 integrate AdminLte Bootstrap admin theme

First of all, We are going to install the Laravel and AdminLTE packages using the composer.

1) Laravel Installation

First of all, We are going to install the Laravel framework using the composer. Let’s follow the command.

composer create-project --prefer-dist laravel/laravel tryvary

You can get more information about the installation by following the Laravel Installation guide.

2) jeroennoten AdminLTE Bootstrap Admin theme

Let’s install the AdminLTE package by following the command.

composer require jeroennoten/laravel-adminlte

After, Installing the package we should publish the AdminLTE bootstrap theme assets and files by following the below command.

php artisan adminlte:install

Finally, We are ready with the installation process of jeroennoten Laravel AdminLTE package.

Now, Let’s create the view with AdminLTE layouts. Also, We are going to see the process steps by step.

3) Laravel AdminLTE Layouts

First of all, We are going to create the Route for admin. For creating route open the route routes/web.php file then write the route for admin like.

Route::get('/admin','AdminController@index');

Now, We are going to create a controller file for a route. So, Create a new file at App\Http\Controllers\AdminController.php and write the controller code like.

<?php

namespace App\Http\Controllers;

use App\Http\Requests;
use Illuminate\Http\Request;

class AdminController extends Controller
{
    public function __construct()
    {
        // $this->middleware('auth');
    }

    public function index(Request $request)
    {
        return view('admin');
    }

}

Finally, We are going to create the view file using AdminLTE admin layout. Create a view file at resources/views/admin.blade.php and write blade code like.

@extends('adminlte::page')

@section('title', 'Dashboard')

@section('content_header')
    <h1>Dashboard</h1>
@stop

@section('content')
    <p>Welcome to this beautiful admin panel.</p>
@stop

Finally, We are ready to run the admin theme. Let’s run the project using the PHP artisan command from the root directory of the project like

php artisan serve

Above, Command creates a virtual URL for the application using the 8000 port. Open localhost:8000/admin URL to the browser and you will see the admin theme like below.

Laravel 6 integrate AdminLte Bootstrap admin theme jeroennoten

Finally, We are ready to use the AdminLTE theme layout. Now, Open the config config/adminlte.php file and change the project name and remove the unused menus.

4 ) Adding Custom CSS/JS

We can easily add the custom CSS and JS file using the blade template. Let’s see it by example just add the below code into Laravel Blade file.

@section('css')
    <style>
    	body{
    		background: red;
    		font-size: 18px;
    		font-weight: normal;
    	}
    </style>
@stop

@section('js')
    <script>
    	alert("Welcome to Javascript!");
    </script>
@stop

5 ) Update The AdminLTE theme

We can easily update the AdminLTE theme without changing the code. For, Updating the admin theme just follow the below command. First of all, We are going to update the Laravel Package.

composer update jeroennoten/laravel-adminlte

After, Updating the package we have to update assets file by following the command.

php artisan adminlte:update

Finally, We are ready with the Laravel AdminLTE admin template.

I hope this article useful for you. Please let us know if anything was missing or wrong by comment.

Related Posts

  1. Email unique validation in Laravel ignore id on update
  2. WordPress Button Shortcode – Add button to WordPress editor
  3. WordPress shortcode – How to create shortcode in WordPress
  4. WordPress change URL in database using MySQL Query
  5. PHP remove HTML tags from string using strip_tags
  6. Enable shortcodes in widget WordPress
  7. PHP remove non-empty directory programmatically
  8. PHP File upload step by step with example
  9. WooCommerce add product to cart with custom price
  10. Laravel Eloquent where null and where not null query

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search Posts

Subscribe To Newsletter

Get Early Access To New Articles, Plugins, Discount Codes And Quickly Brief Updates about tips and tricks

Join 308 other subscribers