Integrate Html Theme in Laravel 9 Project - Taleem Dunya

Lecture 03

Integrate Html Theme in Laravel 9 Project

Integration of Html Theme into Laravel project is the main part of Laravel website project. Laravel is top rated PHP Framework. Laravel is based on the MVC approach.

MVC has three main parts which are given below
1) Model
2) View
3) Controller

Html theme files are basically deployed into view. View blade is used in Laravel to show view/output of the function.
1) All HTML files of theme are copy-pasted into a directory of resources/views
2) Extention of all HTML files is changed into file-name.blade.php
3) CSS/JS files are copy-pasted into the public folder.
4) Images of theme are also copy-pasted into the public folder.

Theme CSS & JS files are set in head tag of blade files of Laravel

Theme CSS & JS files are set in head tag of blade files of Laravel using attribute of asset() or url(). CSS & JS files are paste in public folder and blade files are set in directory of resurces/views.


Main layout blade in Laravel

Blade is the simple, yet powerful templating engine that is included with Laravel. Unlike some PHP templating engines, Blade does not restrict you from using plain PHP code in your templates. In fact, all Blade templates are compiled into plain PHP code and cached until they are modified, meaning Blade adds essentially zero overhead to your application. Blade template files use the .blade.php file extension and are typically stored in the resources/views directory.


Displaying Data in blade

You may display data that is passed to your Blade views by wrapping the variable in curly braces. For example, given the following route


Hello, {{ $name }}
Use this code in welcome.blade.php blade file which is placed in resources/views directory.