Use AdminLTE in Laravel5. * and use AdminLTE in Laravel5. *
AdminLTE is a great background Template built solely by HTML and CSS. in this article, I will show you how to integrate AdminLTE and Laravel elegantly, in addition, we can use Bower to promptly update and manage AdminLTE.
Tools we use
Laravel
AdminLTE 2.3.2
Bower
Composer
Download a brand new Laravel
If you are not sure, go to the official website to view the link
Here we can directly use the command line
composer create-project laravel/laravel myapp --prefer-dist
Using this command, we created a new Laravel project named myapp. if you succeed, you can see the image below.
Download AdminLTE from Bower
Go to the myapp/public folder
cd myapp/public
Execute the following command in this folder
bower install admin-lte
Once completed, you will find an additional bower_componets folder, and in this folder you will see AdminLTE
Convert starter.html of AdminLTE to a Blade Template
Laravel uses a good template engine Blade here. to make full use of Blade, we need to apply some common starting HTML pages to the Blade template, first, create a view named admin_template.blade.php in the resources/views folder, and then create a corresponding route for this page. As shown in the following
Route::get('admin', function () { return view('admin_template'); });
Then, copy the content in bower_components/admin-lte/starter.html to our view template and direct the links to the corresponding directory of AdminLTE. The following is my initial settings: