A video was created with this content, access 👇🏽
https://www.youtube.com/watch?v=gMzf49j9Qm0
Hi guys, In this text I want to show how to add a template manually in laravel, in this tutorial I will use the version of laravel 5.7 and the Fashe template of colorlib, where you will find for free at the link: https://github.com/mauriciocoelho/fashe-colorlib
After you have created the project to have unzipped the downloaded file in the link above, you will copy the files: css, fonts, images, includes, js and vendor, of the file you downloaded.
After that you will create a folder named “app-assets” inside the public folder in your project.
Create any controller for your project, let’s call this controller from Home, use the php artisan make: HomeController controller command.
Let’s create a route for the created controller, use this route: Route::get(‘/home’, ‘HomeController@index’)->name(‘home’);
Now in the Home controller we will create the index function to return in the view.
public function index()
{
return view(‘home’);
}
In resource / views create the file home.blade.php and a folder with the name includes inside the folder layouts as in the picture:
In app.blade.php replace the content with:
@include(‘layouts.includes.header’)
@yield(‘content’)
@include(‘layouts.includes.footer’)
In the includes folder, create the header.blade.php and footer.blade.php
Open the file index.html of the template (fasch-colorlib folder) and select the contents of <!DOCTYPE html> up </ header> and paste it into header.blade.php of your project.
After that you will point the href’s to the app-assets folder that you created in the project’s public folder, doing the following: css, fonts, images, includes e vendor, you will put {{asset (‘app-assets / and then close with’)}} and you’ll get: href = “{{asset (‘app-assets / vendor / bootstrap / css / bootstrap.min.css’)}} “
After selecting the <! — Footer →> to </html> that is in the template’s index.html and paste it into footer.blade.php
change the src path to the app-assets folder that you created in the project’s public folder, doing this: before js and vendor, you will put {{asset (‘app-assets / and then close with’)} : src = “{{asset (‘app-assets / vendor / slick / slick.min.js”
At home.blade.index type:
@extends(‘layouts.app’)
@section(‘content’)
@endsection
Inside @section (‘content’) copy and paste the remaining code that is left of index.html which is of <! — Slide1 →> until </ section> after doing so put your project to run with
php artisan serve
My English language is still bad, I’m sorry if you do not understand
A video was created with this content, access 👇🏽