This’s a complete guide to integrate AdminLTE in Laravel. A big help for web developers like me that is not a (pro) front-end developer. This is for you if you want a responsive web app template and you don’t want to start from scratch. Thanks to AdminLTE, a popular open-source web app template that will help you create interfaces such as admin dashboards and control panels.

Steps to Integrate AdminLTE in Laravel

This is a two-step guide with sub-steps that will walk you through to install Laravel using Composer and integrate AdminLTE in Laravel.

The following steps use the Composer dependency management to easily integrate AdminLTE in Laravel.

Step 1: Install Laravel Using Composer

Before we integrate AdminLTE in Laravel, we first need to install Laravel on our server. Remember that Laravel framework has few system requirements. If you’re not using Laravel Homestead then you need to make sure that the following has already installed on your server.

  • PHP >= 7.1.3. Open a terminal and check your PHP version by typing php -v command.

php -v check php version

  • PHP extensions required are OpenSSL, PDO, Mbstring, Tokenizer, XML, Ctype and JSON. Type php -m command to list all PHP extensions.

php -m check php modules

a. From your terminal, navigate to directory where you want to install Laravel.

b. Create your Laravel project using the composer create-project --prefer-dist laravel/laravel command. Composer will install all Laravel’s necessary files.

composer-create-project --prefer-dist laravel-laravel create laravel project using composer

Installation should end with a message Application key set successfully.

composer-create-project --prefer-dist laravel-laravel create laravel project using composer successful

Open a browser and navigate to your project URL.

Fix the issue by appending public/ to all assets URL. Here’s the list of files to update.

  • views/auth/passwords/master.blade.php
  • views/auth/passwords/login.blade.php
  • views/auth/login.blade.php
  • views/auth/register.blade.php
  • views/auth/verify.blade.php

PHP Artisan Migrate Error

After running php artisan migrate command it throws an error Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes.

To fix the issue you have to edit app/Providers/AppServiceProvider.php file. Inside boot function set a default string length by adding this line Schema::defaultStringLength(191);. Now boot function should look like this.

public function boot()
{
Schema::defaultStringLength(191);
}

We hope this topic on integrating AdminLTE in Laravel helped you create your responsive web app without starting from scratch.

If you want to develop your Laravel app as a single-page application (SPA) where you can perform CRUD (create, read, update, delete) operation, follow our guide here on Laravel Vue JS CRUD SPA (Single-Page Application) tutorial.