{"id":138641,"date":"2020-09-03T10:44:18","date_gmt":"2020-09-03T10:44:18","guid":{"rendered":"https:\/\/www.softwaretestinghelp.com\/?page_id=138641"},"modified":"2025-04-01T08:34:26","modified_gmt":"2025-04-01T08:34:26","slug":"php-laravel-tutorial-for-beginners","status":"publish","type":"page","link":"https:\/\/www.softwaretestinghelp.com\/php-laravel-tutorial-for-beginners\/","title":{"rendered":"PHP Laravel Tutorial for Beginners: What Is Laravel Framework"},"content":{"rendered":"<p><strong>This Laravel tutorial introduces the PHP Laravel Framework, explains what is Laravel, how to install it, MVC architecture, and various components:<\/strong><\/p>\n<p><strong>Laravel Framework<\/strong> is a <strong>free and open-source web framework for PHP.<\/strong> It is used to develop complex web applications. It is based on the <strong>Model-View-Controller (MVC)<\/strong> architectural design pattern.<\/p>\n<p>You will learn about the history, features, advantages, architecture, installation, and components of the Laravel Framework.<\/p>\n<p><strong><em> <\/em><\/strong><\/p>\n<h3><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/Laravel-Tutorial-for-Beginners.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-138688\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/Laravel-Tutorial-for-Beginners.png\" alt=\"Laravel Tutorial for Beginners\" width=\"700\" height=\"394\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/Laravel-Tutorial-for-Beginners.png 700w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/Laravel-Tutorial-for-Beginners-300x169.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><\/h3>\n<h2>List Of Laravel Tutorials<\/h2>\n<p><strong>Tutorial #1: <a href=\"https:\/\/www.softwaretestinghelp.com\/php-laravel-tutorial-for-beginners\/\">PHP Laravel Tutorial for Beginners<\/a> (This Tutorial)<\/strong><br \/>\n<strong>Tutorial #2: <a href=\"https:\/\/www.softwaretestinghelp.com\/laravel-database-migrations\/\">Laravel Database, Migrations, Eloquent ORM And Tinker<\/a><\/strong><br \/>\n<strong>Tutorial #3: <a href=\"https:\/\/www.softwaretestinghelp.com\/laravel-forms-and-validation\/\">Laravel Forms And Validation Rules With Example\u00a0<\/a><\/strong><br \/>\n<strong>Tutorial #4: <a href=\"https:\/\/www.softwaretestinghelp.com\/laravel-session-and-file-permissions\/\">Laravel Session, File Upload\/Download And Permissions<\/a><\/strong><br \/>\n<strong>Tutorial #5: <a href=\"https:\/\/www.softwaretestinghelp.com\/laravel-collection-and-forge-tutorial\/\">Laravel Collection And Laravel Forge Tutorial<\/a><\/strong><br \/>\n<strong>Tutorial #6:\u00a0<a href=\"https:\/\/www.softwaretestinghelp.com\/laravel-interview-questions\/\">Laravel Interview Questions And Answers<\/a><\/strong><\/p>\n<hr \/>\n<h2>What Is Laravel<\/h2>\n<p><span style=\"color: #ff6600;\"><strong>History:<\/strong><\/span><\/p>\n<p>The Laravel Framework was developed by <strong>Taylor Otwell<\/strong> and released to the public in the year <strong>2011<\/strong>.<\/p>\n<p><strong>The following table shows the different versions of Laravel.<\/strong><\/p>\n\n<div id=\"tablepress-1628-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-1628\" class=\"tablepress tablepress-id-1628 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Version<\/th><th class=\"column-2\">Date of Release<\/th><th class=\"column-3\">PHP Version Support<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">1.0<\/td><td class=\"column-2\">June 2011<\/td><td class=\"column-3\">-------------------------------------------<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">2.0<\/td><td class=\"column-2\">September 2011<\/td><td class=\"column-3\">-------------------------------------------<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">3.0<\/td><td class=\"column-2\">February 22nd, 2012<\/td><td class=\"column-3\">-------------------------------------------<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">4.0<\/td><td class=\"column-2\">May 28th, 2013<\/td><td class=\"column-3\">Minimum 5.3.0<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">5.0<\/td><td class=\"column-2\">February 4th, 2015<\/td><td class=\"column-3\">Minimum 5.4.0<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">5.1<\/td><td class=\"column-2\">June 9th, 2015<\/td><td class=\"column-3\">Minimum 5.5.9<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">5.2<\/td><td class=\"column-2\">December 21st, 2015<\/td><td class=\"column-3\">Between 5.5.9 and 7.1.*<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\">5.3<\/td><td class=\"column-2\">August 23rd, 2016<\/td><td class=\"column-3\">Between 5.6.4 and 7.1.*<\/td>\n<\/tr>\n<tr class=\"row-10\">\n\t<td class=\"column-1\">5.4<\/td><td class=\"column-2\">January 24th, 2017<\/td><td class=\"column-3\">5.6.4 or above<\/td>\n<\/tr>\n<tr class=\"row-11\">\n\t<td class=\"column-1\">5.5<\/td><td class=\"column-2\">August 30th, 2017<\/td><td class=\"column-3\">7.0.0 or above<\/td>\n<\/tr>\n<tr class=\"row-12\">\n\t<td class=\"column-1\">5.6<\/td><td class=\"column-2\">February 7th, 2018<\/td><td class=\"column-3\">7.1.3 or above<\/td>\n<\/tr>\n<tr class=\"row-13\">\n\t<td class=\"column-1\">5.7<\/td><td class=\"column-2\">September 4th, 2018<\/td><td class=\"column-3\">7.1.3 or above<\/td>\n<\/tr>\n<tr class=\"row-14\">\n\t<td class=\"column-1\">5.8<\/td><td class=\"column-2\">February 26th, 2019<\/td><td class=\"column-3\">7.1.3 or above<\/td>\n<\/tr>\n<tr class=\"row-15\">\n\t<td class=\"column-1\">6.x<\/td><td class=\"column-2\">September 3rd, 2019<\/td><td class=\"column-3\">7.2.0 or above<\/td>\n<\/tr>\n<tr class=\"row-16\">\n\t<td class=\"column-1\">7.x<\/td><td class=\"column-2\">March 3rd, 2020<\/td><td class=\"column-3\">7.2.5 or above<\/td>\n<\/tr>\n<tr class=\"row-17\">\n\t<td class=\"column-1\">8.x<\/td><td class=\"column-2\">Laravel 8 is yet to be released (in 2020)<\/td><td class=\"column-3\">7.3.0 or above<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-1628 from cache -->\n<p><strong>Note:<\/strong> In this <strong>Laravel tutorial<\/strong>, we have used <strong>Laravel version 7 <\/strong>in all the examples.<\/p>\n<p><span style=\"color: #ff6600;\"><strong>Popularity:<\/strong><\/span><\/p>\n<p>There are lots of frameworks available in the industry such as Laravel, Symfony, Codeigniter, Yii, CakePHP, and Zend framework for PHP.<\/p>\n<p><strong><em>So what do you think, which one is the<\/em> <em>most popular PHP Framework?<\/em><\/strong> The answer is <strong>Laravel<\/strong>.<\/p>\n<p>The following screenshot of <strong>Google Trends<\/strong> shows the analysis of the popularity of different PHP frameworks.<\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/Google-Trends.png\"><img decoding=\"async\" class=\"alignnone wp-image-138644 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/Google-Trends.png\" alt=\"analysis of the popularity of different PHP frameworks\" width=\"649\" height=\"496\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/Google-Trends.png 649w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/Google-Trends-300x229.png 300w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><\/a><\/p>\n<p><em>[image<a href=\"https:\/\/trends.google.com\/\" target=\"_blank\" rel=\"noopener nofollow\"> source<\/a>]<\/em><\/p>\n<p><strong><span style=\"color: #ff6600;\">Advantages:<\/span><\/strong><\/p>\n<p><strong>The following list shows some advantages of the Laravel Framework.<\/strong><\/p>\n<ul>\n<li>Follows MVC architectural design pattern<\/li>\n<li>Free and open-source<\/li>\n<li>Easy to learn<\/li>\n<li>Good documentation support<\/li>\n<li>Easy to integrate<\/li>\n<li>High performance and efficiency<\/li>\n<li>A high level of security<\/li>\n<\/ul>\n<p><span style=\"color: #ff6600;\"><strong>Features:<\/strong><\/span><\/p>\n<p>Laravel has a rich set of features. <strong>These are as follows:<\/strong><\/p>\n<ul>\n<li><strong>Modularity:<\/strong> Laravel has many built-in libraries and modules which help developers to build responsive and modular PHP web applications. This feature also speeds up development.<\/li>\n<li><strong>Lazy Collection:<\/strong> It handles heavy loads of data with the minimum usage of memory.<\/li>\n<li><strong><a href=\"https:\/\/www.softwaretestinghelp.com\/laravel-database-migrations\/\">Eloquent ORM<\/a>:<\/strong> ORM stands for <strong>Object Relation Mapping<\/strong>. Laravel has a built-in ORM called <strong>Eloquent <\/strong>which handles database related operations.<\/li>\n<li><strong>Artisan:<\/strong> Artisan is the <strong>command-line interface<\/strong> used in Laravel.<\/li>\n<li><strong>Blade templates:<\/strong> Laravel has a concept called <strong>Blade, <\/strong>which creates a unique template to display data.<\/li>\n<li><strong>Unit testing:<\/strong> Test cases can be used to perform unit testing in Laravel.<\/li>\n<li><strong>Email support:<\/strong> Laravel has a built-in class called <strong>Mail,<\/strong> which helps to send emails.<\/li>\n<li><strong>Authentication:<\/strong> Authentication is used to identify the users of the system. It is usually achieved by identifying the username and password of the user.<\/li>\n<\/ul>\n<h3>MVC Architecture Of Laravel<\/h3>\n<p>The Laravel Framework follows <strong>MVC architecture<\/strong>. MVC is an architectural design pattern that helps to develop web applications faster. <strong>MVC<\/strong> stands for <strong>Model-View-Controller<\/strong>.<\/p>\n<ul>\n<li><strong>Model (M)<\/strong>\u2013A model handles data used by the web application.<\/li>\n<li><strong>View (V)<\/strong>\u2013A view helps to display data to the user.<\/li>\n<li><strong>Controller (C)<\/strong>\u2013A controller interacts with the model to create data for the view.<\/li>\n<\/ul>\n<p><strong>The following screenshot shows the interactions between Model, View, and Controller.<\/strong><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/Image-from-the-Internet-MVC-Architecture.png\"><img decoding=\"async\" class=\"alignnone wp-image-138645 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/Image-from-the-Internet-MVC-Architecture.png\" alt=\" MVC Architecture\" width=\"600\" height=\"369\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/Image-from-the-Internet-MVC-Architecture.png 600w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/Image-from-the-Internet-MVC-Architecture-300x185.png 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><em>[image<a href=\"https:\/\/developer.mozilla.org\" target=\"_blank\" rel=\"noopener nofollow\"> source<\/a>]<\/em><\/p>\n<p><strong>Pre-requisites For Laravel<\/strong><\/p>\n<p>Before proceeding further with this tutorial, you need to be familiar with the following concepts.<\/p>\n<ul>\n<li>HTML and CSS<\/li>\n<li>Core PHP and Advanced PHP<\/li>\n<li>Web application development using PHP and MySQL<\/li>\n<li>MVC architecture (we have already covered some basics of MVC architecture in this tutorial)<\/li>\n<\/ul>\n<h3>Install Laravel Framework 7 For Windows<\/h3>\n<p><span style=\"color: #000000;\"><strong>Prerequisites for Installing Laravel 7:<\/strong><\/span><\/p>\n<p>Before installing the Laravel Framework, install the following programs on your computer. <strong>PHP version 7.2.5<\/strong> is the minimum compatible version of PHP for <strong>Laravel version 7<\/strong>.<\/p>\n<ul>\n<li>Web Server such as Apache<\/li>\n<li>PHP version 7.2.5 or above version<\/li>\n<li>PHP extensions<strong>*<\/strong>\n<ul>\n<li>BCMath PHP Extension<\/li>\n<li>Ctype PHP Extension<\/li>\n<li>Fileinfo PHP extension<\/li>\n<li>JSON PHP Extension<\/li>\n<li>Mbstring PHP Extension<\/li>\n<li>OpenSSL PHP Extension<\/li>\n<li>PDO PHP Extension<\/li>\n<li>Tokenizer PHP Extension<\/li>\n<li>XML PHP Extension<\/li>\n<\/ul>\n<\/li>\n<li>MySQL<\/li>\n<li>Composer (See the next topic for the URL to download and install Composer)<\/li>\n<\/ul>\n<p><strong>*Note:<\/strong> Above PHP extensions might be pre-installed on your system.<\/p>\n<h3>Composer<\/h3>\n<p>Composer is a <strong>dependency manager for PHP<\/strong>. Laravel uses the <strong>Composer<\/strong> to manage its dependencies.<\/p>\n<p>You need to install the composer before installing Laravel. If you have not installed the composer, visit the following <a href=\"https:\/\/getcomposer.org\/\" target=\"_blank\" rel=\"noopener nofollow\">URL<\/a> to download and install the composer.<\/p>\n<p>Run the following command in the command prompt to check whether or not you have successfully installed the composer on your computer.<\/p>\n<pre>composer<\/pre>\n<p>If you have installed the composer successfully, a screen similar to below will be displayed. It also shows the installed version of the composer.<\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/composer.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-138646\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/composer.png\" alt=\"composer\" width=\"684\" height=\"485\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/composer.png 684w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/composer-300x213.png 300w\" sizes=\"(max-width: 684px) 100vw, 684px\" \/><\/a><\/p>\n<p><span style=\"color: #ff6600;\"><strong>Download Laravel Installer<\/strong><\/span><\/p>\n<p>Run the following command in the command prompt to download the <strong>Laravel installer<\/strong> on your computer using the composer.<\/p>\n<pre>composer global require laravel\/installer<\/pre>\n<h3>Creating First Laravel PHP Project<\/h3>\n<p>Run the following command in the command prompt to create a new <strong>Laravel PHP project<\/strong> named <strong>laravel-tutorial<\/strong> (you can use any name) using the composer. It will create the Laravel project in the current directory.<\/p>\n<pre>composer create-project --prefer-dist laravel\/laravel laravel-tutorial<\/pre>\n<p><span style=\"color: #ff6600;\"><strong>Running First Laravel PHP Project On Localhost<\/strong><\/span><\/p>\n<p>Go to the Laravel PHP project folder in the command prompt by running the following command.<\/p>\n<pre>cd laravel-tutorial<\/pre>\n<p>Then, run the following command in the command prompt to start the Laravel development server.<\/p>\n<pre>php artisan serve<\/pre>\n<p><strong>The following screenshot shows the output of the above command.<\/strong><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/php-artisan-serve.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-138647\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/php-artisan-serve.png\" alt=\"php artisan serve\" width=\"524\" height=\"124\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/php-artisan-serve.png 524w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/php-artisan-serve-300x71.png 300w\" sizes=\"(max-width: 524px) 100vw, 524px\" \/><\/a><\/p>\n<p>Copy the above <strong>URL: http:\/\/127.0.0.1:8000<\/strong>\u00a0and open it in a web browser.<\/p>\n<p>If you have run the Laravel project successfully you will see a screen similar to below.<\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/welcome.png\"><img decoding=\"async\" class=\"alignnone wp-image-138648 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/welcome.png\" alt=\"Laravel project successfully\" width=\"403\" height=\"67\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/welcome.png 403w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/welcome-300x50.png 300w\" sizes=\"(max-width: 403px) 100vw, 403px\" \/><\/a><\/p>\n<p><strong>Congratulations! You have successfully run your first Laravel project.<\/strong><\/p>\n<h2>Laravel PHP Project Structure<\/h2>\n<p>The project structure consists of directories, sub-directories, and files.<\/p>\n<p><strong>Note: <\/strong>A directory is also known as a <strong>folder<\/strong>.<\/p>\n<p>Open your project from the <strong>File Explorer<\/strong> to see the root directory structure of the Laravel project. You will see a screen similar to below.<\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/project-directory-structure.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-138649\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/project-directory-structure.png\" alt=\"project directory structure\" width=\"600\" height=\"571\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/project-directory-structure.png 600w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/project-directory-structure-300x286.png 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><strong>The following list describes some important directories, sub-directories, and files in a typical Laravel project:<\/strong><\/p>\n<ul>\n<li><strong>app directory: <\/strong>This directory is one of the most important directories in the root. The app directory contains the source code of the web application. It includes the following sub-directories and the <strong>User.php <\/strong>file.\n<ul>\n<li><strong>Console directory:<\/strong> This directory contains <strong>artisan commands<\/strong> required for Laravel.<\/li>\n<li><strong>Exceptions<\/strong> <strong>directory:<\/strong> This directory contains <strong>exception handlers<\/strong>.<\/li>\n<li><strong>Http directory:<\/strong> This directory contains sub-directories for <strong>Controllers <\/strong>and <strong>Middleware.<\/strong><\/li>\n<li><strong>Providers<\/strong> <strong>directory:<\/strong> This directory contains all the <strong>service providers<\/strong>.<\/li>\n<li><strong>User.php file:<\/strong> This is the default <strong>Model<\/strong> provided by Laravel.<\/li>\n<\/ul>\n<\/li>\n<li><strong>bootstrap<\/strong> <strong>directory:<\/strong> This directory contains files related to bootstrap the Laravel PHP application.<\/li>\n<li><strong>config<\/strong> <strong>directory:<\/strong> This directory contains various <strong>configuration files<\/strong> required for the Laravel PHP application.<\/li>\n<li><strong>database<\/strong> <strong>directory:<\/strong> This directory contains files related to the database. It includes the following sub-directories and the .<strong>gitignore <\/strong>file.\n<ul>\n<li><strong>factories directory:<\/strong> This directory generates many data records.<\/li>\n<li><strong>migrations directory:<\/strong> This directory contains files related to <strong>database migrations<\/strong>.<\/li>\n<li><strong>seeds<\/strong> <strong>directory:<\/strong> This directory contains <strong>classes<\/strong> used for the unit testing database.<\/li>\n<\/ul>\n<\/li>\n<li><strong>public<\/strong> <strong>directory:<\/strong> This directory contains files that help to initialize the Laravel PHP application.<\/li>\n<li><strong>resources<\/strong> <strong>directory:<\/strong> This directory contains HTML files, CSS files, JavaScript files, and blade templates. It includes the following sub-directories.\n<ul>\n<li><strong>js directory:<\/strong> This directory contains files related to <strong>JavaScript<\/strong>.<\/li>\n<li><strong>lang<\/strong> <strong>directory:<\/strong> This directory contains files for <strong>localization and internalization<\/strong>.<\/li>\n<li><strong>saas<\/strong> <strong>directory:<\/strong> This directory contains files such as <strong>SCSS<\/strong> files.<\/li>\n<li><strong>views<\/strong> <strong>directory:<\/strong> This directory contains <strong>HTML files or templates<\/strong> which help to display data to the user.<\/li>\n<\/ul>\n<\/li>\n<li><strong>routes<\/strong> <strong>directory:<\/strong> This directory contains all the <strong>routes definitions<\/strong> for the Laravel PHP application.<\/li>\n<li><strong>storage<\/strong> <strong>directory:<\/strong> This directory contains <strong>cache files, <a href=\"https:\/\/www.softwaretestinghelp.com\/laravel-session-and-file-permissions\/\">session<\/a> files, etc<\/strong>.<\/li>\n<li><strong>tests directory:<\/strong> This directory contains <strong>test files<\/strong> such as unit test files.<\/li>\n<li><strong>vendor<\/strong> <strong>directory:<\/strong> This directory contains all the <strong>composer dependency packages<\/strong>.<\/li>\n<li><strong>.env file:<\/strong> This file includes <strong>environmental variables<\/strong>.<\/li>\n<li><strong>composer.json file:<\/strong> This file is a <strong>configuration file<\/strong> that specifies dependencies.<\/li>\n<li><strong>package.json file:<\/strong> This file is similar to the <strong>composer.json<\/strong> file but it is for the <strong>frontend<\/strong>.<\/li>\n<li>and few more files<\/li>\n<\/ul>\n<h3>Introduction To Laravel Routes<\/h3>\n<p>Routing accepts the request and redirects it to the relevant controller function.<\/p>\n<p><strong>There are two main route files in the Laravel Framework:<\/strong><\/p>\n<ul>\n<li><strong>routes\/web.php: <\/strong>This file is used to register <strong>web routes<\/strong>.<\/li>\n<li><strong>routes\/api.php: <\/strong>This file is used to register <strong>API routes<\/strong>.<\/li>\n<\/ul>\n<p>The following code segment shows the default web route registered by Laravel to display the <strong>welcome<\/strong> page.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">Route::get('\/', function () {\r\n    return view('welcome');\r\n});\r\n<\/pre>\n<p>In the above route, <strong>Route<\/strong> is the class used to define the function <strong>get()<\/strong>. The function <strong>get()<\/strong> has a parameter \u201c<strong>\/<\/strong>\u201d which indicates the root URL of the Laravel application.<\/p>\n<p><strong>The following screenshot shows the output of the above route.<\/strong><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/welcome-1.png\"><img decoding=\"async\" class=\"alignnone wp-image-138651 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/welcome-1.png\" alt=\"Route output\" width=\"403\" height=\"67\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/welcome-1.png 403w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/welcome-1-300x50.png 300w\" sizes=\"(max-width: 403px) 100vw, 403px\" \/><\/a><\/p>\n<p>The following command can be run in the command prompt to get the full list of registered routes.<\/p>\n<pre>php artisan route:list<\/pre>\n<p><span style=\"color: #ff6600;\"><strong>Creating a Route<\/strong><\/span><\/p>\n<p><strong>Step 1:<\/strong> Add the following code segment in <strong>routes\/web.php <\/strong>file to register a new route.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">Route::get('\/example', function () {\r\n    return &quot;Hello World!!!&quot;;\r\n});\r\n<\/pre>\n<p><strong>Step 2:<\/strong> Visit the <strong>URL: http:\/\/127.0.0.1:8000\/example<\/strong> to see the output.<\/p>\n<p><strong>Step 3<\/strong>: The following screenshot shows the output.<\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/route-output.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-138652\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/route-output.png\" alt=\"route (output)\" width=\"274\" height=\"92\" \/><\/a><\/p>\n<p><span style=\"color: #ff6600;\"><strong>Routing Parameters<\/strong><\/span><\/p>\n<p>The Laravel Framework uses two types of route parameters.<\/p>\n<p><span style=\"color: #000000;\"><strong>#1) Required parameters<\/strong><\/span><\/p>\n<p>The required parameters are the parameters that pass to the URL as shown below.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">Route::get('user\/{name}', function ($name='Paul') {  \r\n    return $name;  \r\n});\r\n<\/pre>\n<p><span style=\"color: #000000;\"><strong>#2) Optional parameters<\/strong><\/span><\/p>\n<p>Place \u201c<strong>?<\/strong>\u201d after the router parameter to make it <strong>optional<\/strong> as shown below.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">Route::get('user\/{name?}', function ($name='Paul') {  \r\n    return $name;  \r\n});\r\n<\/pre>\n<p><span style=\"color: #ff6600;\"><strong>Named Routes<\/strong><\/span><\/p>\n<p>In the following route, the <strong>report controller<\/strong> will call the function <strong>showReport<\/strong> with parameters as the <strong>report<\/strong>.<\/p>\n<pre>Route::get(student\/report, 'ReportController@showReport')-&gt;name(report);<\/pre>\n<h3>Laravel Controllers<\/h3>\n<p>In MVC architecture, the character \u2018C\u2019 stands for <strong>Controller<\/strong>. A controller communicates with the relevant model if necessary and loads the view to display the content for the user.<\/p>\n<p>All the controllers are stored in the <strong>app\/Http\/Controllers <\/strong>directory.<\/p>\n<p><span style=\"color: #ff6600;\"><strong>Creating a Controller<\/strong><\/span><\/p>\n<p>Run the following command in the command prompt to create a controller named <strong>UserContoller<\/strong>.<\/p>\n<pre>php artisan make:controller UserController<\/pre>\n<p>This command will create a file named <strong>UserController.php <\/strong>in the <strong>app\/Http\/Controllers<\/strong> directory. By default, the <strong>Controller.php<\/strong> file is included with the Laravel Framework.<\/p>\n<p><span style=\"color: #ff6600;\"><strong>Calling Controllers from Routes<\/strong><\/span><\/p>\n<p><strong>The following syntax can be used to call controllers from routes.<\/strong><\/p>\n<pre>Route::get(\u2018base\u00a0URI\u2019,\u2019controller@method\u2019);<\/pre>\n<p>Let\u2019s see an example.<\/p>\n<p><strong>Step 1:<\/strong> Add the following code segment in the <strong>routes\/web.php<\/strong> file to register a new route.<\/p>\n<pre>Route::get('\/assessment',\u00a0'AssessmentController@index');<\/pre>\n<p><strong>Step 2:<\/strong> Run the following command in the command prompt to create a controller named <strong>AssessmentController<\/strong>.<\/p>\n<pre>php artisan make:controller AssessmentController<\/pre>\n<p>This command will create a file named <strong>AssessementController.php<\/strong> in the <strong>app\/Http\/Controllers<\/strong> directory.<\/p>\n<p><strong>Step 3:<\/strong> Create the <strong>index<\/strong> function in the <strong>AssessementController<\/strong> as shown below.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&amp;lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass AssessmentController extends Controller\r\n{\r\n    public function index()\r\n    {        \r\n        return view('assessment');\r\n    }\r\n}\r\n<\/pre>\n<p><strong>Step 4:<\/strong> Create a view named <strong>assessment.php<\/strong> in the <strong>resources\/views <\/strong>directory and save the following code.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&amp;lt;!DOCTYPE html&amp;gt;\r\n&amp;lt;html lang=&quot;en&quot;&amp;gt;\r\n    &amp;lt;body&amp;gt;\r\n        &amp;lt;h1&amp;gt;Laravel Assessment&amp;lt;\/h1&amp;gt;\r\n    &amp;lt;\/body&amp;gt;\r\n&amp;lt;\/html&amp;gt;\r\n<\/pre>\n<p><strong>Step 5:<\/strong> Visit the <strong>URL: http:\/\/127.0.0.1:8000\/assessment<\/strong> to see the output.<\/p>\n<p><strong>Step 6:<\/strong> The following screenshot shows the output.<\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/calling-controllers-from-routes-output.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-138656\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/calling-controllers-from-routes-output.png\" alt=\"calling controllers from routes (output)\" width=\"293\" height=\"116\" \/><\/a><\/p>\n<h3>Restful Resource Controllers<\/h3>\n<p>There are seven restful resource controllers in the Laravel Framework.<\/p>\n<p><strong>Run the following command in the command prompt to create restful resource controllers.<\/strong><\/p>\n<pre>php artisan make:controller StudentController --resource<\/pre>\n<p>This command will create a file named <strong>StudentContoller.php<\/strong> in the <strong>app\/Http\/Controllers<\/strong> directory and it contains functions for each resource action.<\/p>\n<p><strong>The following route can be used to register a restful route.<\/strong><\/p>\n<pre>Route::resource('\/students',\u00a0'StudentController');<\/pre>\n<p><strong>The following table shows the actions handled by the Restful Resource Controllers:<\/strong><\/p>\n\n<div id=\"tablepress-1629-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-1629\" class=\"tablepress tablepress-id-1629 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Request Type<\/th><th class=\"column-2\">Path (URI)<\/th><th class=\"column-3\">Action<\/th><th class=\"column-4\">Route Name<\/th><th class=\"column-5\">Use<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">GET<\/td><td class=\"column-2\">\/students<\/td><td class=\"column-3\">index<\/td><td class=\"column-4\">students.index<\/td><td class=\"column-5\">get all students<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">GET<\/td><td class=\"column-2\">\/students \/create<\/td><td class=\"column-3\">create<\/td><td class=\"column-4\">students.create<\/td><td class=\"column-5\">create a new student<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">POST<\/td><td class=\"column-2\">\/students<\/td><td class=\"column-3\">store<\/td><td class=\"column-4\">students.store<\/td><td class=\"column-5\">store student details<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">GET<\/td><td class=\"column-2\">\/students \/{student}<\/td><td class=\"column-3\">show<\/td><td class=\"column-4\">students.show<\/td><td class=\"column-5\">get student details<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">GET<\/td><td class=\"column-2\">\/students \/{student}\/edit<\/td><td class=\"column-3\">edit<\/td><td class=\"column-4\">students.edit<\/td><td class=\"column-5\">edit student<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">PUT\/PATCH<\/td><td class=\"column-2\">\/students \/{student}<\/td><td class=\"column-3\">update<\/td><td class=\"column-4\">students.update<\/td><td class=\"column-5\">update student<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">DELETE<\/td><td class=\"column-2\">\/students \/{student}<\/td><td class=\"column-3\">destroy<\/td><td class=\"column-4\">students.destroy<\/td><td class=\"column-5\">delete student<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-1629 from cache -->\n<h3>What Is Middleware<\/h3>\n<p>In simple words, middleware is a bridge between a request and a response. It provides a mechanism to filter <strong>HTTP<\/strong> requests.<\/p>\n<p>All the middleware files are stored in the <strong>app\/Http\/Middleware <\/strong>directory.<\/p>\n<p>The Laravel Framework has a middleware to check whether the user of the Laravel application is authenticated or not. If the user is authenticated, it directs to the home page and if the user is not authenticated, it redirects to the login page.<\/p>\n<p><strong><span style=\"color: #ff6600;\">Creating a Middleware<\/span><\/strong><\/p>\n<p><strong>Step 1:<\/strong> Run the following command in the command prompt to create a middleware called <strong>CheckUser<\/strong>.<\/p>\n<pre>php artisan make:middleware CheckUser<\/pre>\n<p>This command will create a file named <strong>CheckUser.php<\/strong> in the <strong>app\/Http\/Middleware <\/strong>directory.<\/p>\n<p><strong>Step 2:<\/strong> Open the <strong>CheckUser.php<\/strong> file and modify the existing code as shown below.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&amp;lt;?php\r\n\r\nnamespace App\\Http\\Middleware;\r\n\r\nuse Closure;\r\n\r\nclass CheckUser\r\n{\r\n    \/**\r\n     * Handle an incoming request.\r\n     *\r\n     * @param  \\Illuminate\\Http\\Request  $request\r\npublic function handle($request, Closure $next)\r\n    {\r\n        echo &quot;Test Middleware &amp;lt;br&amp;gt;&quot;;\r\n        return $next($request);\r\n    }\r\n}\r\n<\/pre>\n<p><strong>Step 3:<\/strong> Open the <strong>Kernel.php<\/strong> file in the <strong>app\/Http<\/strong> directory and add the path of the <strong>CheckUser<\/strong> middleware as shown below.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">protected $routeMiddleware = &#x5B;\r\n    'auth' =&amp;gt; \\App\\Http\\Middleware\\Authenticate::class,\r\n    'auth.basic' =&amp;gt; \\Illuminate\\Auth\\Middleware\\AuthenticateWithBasicAuth::class,\r\n    'bindings' =&amp;gt; \\Illuminate\\Routing\\Middleware\\SubstituteBindings::class,\r\n    'cache.headers' =&amp;gt; \\Illuminate\\Http\\Middleware\\SetCacheHeaders::class,\r\n    'can' =&amp;gt; \\Illuminate\\Auth\\Middleware\\Authorize::class,\r\n    'guest' =&amp;gt; \\App\\Http\\Middleware\\RedirectIfAuthenticated::class,\r\n    'password.confirm' =&amp;gt; \\Illuminate\\Auth\\Middleware\\RequirePassword::class,\r\n    'signed' =&amp;gt; \\Illuminate\\Routing\\Middleware\\ValidateSignature::class,\r\n    'throttle' =&amp;gt; \\Illuminate\\Routing\\Middleware\\ThrottleRequests::class,\r\n    'verified' =&amp;gt; \\Illuminate\\Auth\\Middleware\\EnsureEmailIsVerified::class,\r\n    'check' =&amp;gt; \\App\\Http\\Middleware\\CheckUser::class,\r\n];\r\n<\/pre>\n<p><strong>Step 4:<\/strong> Add the following code segment in the <strong>routes\/web.php <\/strong>file to register a new route.<\/p>\n<pre>Route::get('\/test,\u00a0'UserController@create')-&gt;middleware('check');<\/pre>\n<p><strong>Step 5:<\/strong> We have already created the <strong>User Controller<\/strong>. Open the <strong>UserController.php<\/strong> file and modify the existing code as shown below.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&amp;lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass UserController extends Controller\r\n{\r\n    public function create()\r\n    {        \r\n        return view('assessment');\r\n    }\r\n}\r\n<\/pre>\n<p><strong>Step 4:<\/strong> Visit the following <strong>URL: http:\/\/127.0.0.1:8000\/test<\/strong> to see the output.<\/p>\n<p><strong>Step 5:<\/strong> The following screenshot shows the output.<\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/middleware-output.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-138658\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/middleware-output.png\" alt=\"middleware (output)\" width=\"280\" height=\"164\" \/><\/a><\/p>\n<h3>Introduction To Terminable Middleware<\/h3>\n<p>Run the following command in the command prompt to create a terminable middleware named <strong>TerminateMiddleware<\/strong>.<\/p>\n<pre>php artisan make:middleware TerminateMiddleware<\/pre>\n<p>This command will create a file named <strong>TerminateMiddleware.php <\/strong>in the <strong>app\/Http\/Middleware<\/strong> directory.<\/p>\n<p>Terminable middleware works right after any response sent to the browser.<\/p>\n<h3>Introduction To Views<\/h3>\n<p>In MVC architecture, the character \u2018V\u2019 stands for <strong>View<\/strong>. Views contain HTML, CSS and JavaScript. The <strong>Views<\/strong> represent the <strong>frontend<\/strong> of the Laravel application, and it is used to display the content for the user.<\/p>\n<p>All the views are stored in the <strong>resources\/views <\/strong>directory. By default, the Laravel Framework provides the <strong>welcome.blade.php<\/strong> file.<\/p>\n<p><strong><span style=\"color: #ff6600;\">Creating a View<\/span><\/strong><\/p>\n<p><strong>Step 1:<\/strong> Create a view named <strong>index.php<\/strong> in the <strong>resources\/views <\/strong>directory and save the following code.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&amp;lt;!DOCTYPE html&amp;gt;\r\n&amp;lt;html lang=&quot;en&quot;&amp;gt;\r\n    &amp;lt;body&amp;gt;\r\n        &amp;lt;h1&amp;gt;Hello World!&amp;lt;\/h1&amp;gt;\r\n    &amp;lt;\/body&amp;gt;\r\n&amp;lt;\/html&amp;gt;\r\n<\/pre>\n<p><strong>Step 2:<\/strong> Add the following code segment in the <strong>routes\/web.php <\/strong>file to register a new route.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">Route::get('\/index', function () {\r\n    return view('index');\r\n});\r\n<\/pre>\n<p><strong>Step 3:<\/strong> Visit the <strong>URL: http:\/\/127.0.0.1:8000\/index<\/strong> to see the output.<\/p>\n<p><strong>Step 4:<\/strong> The following screenshot shows the output.<\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/create-a-view-output.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-138661\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/create-a-view-output.png\" alt=\"create a view (output)\" width=\"262\" height=\"120\" \/><\/a><\/p>\n<p><strong><span style=\"color: #ff6600;\">Passing Data to Views<\/span><\/strong><\/p>\n<p>Let\u2019s do an example to see how data can be passed to the view.<\/p>\n<p><strong>Step 1:<\/strong> Create a view named <strong>user.php<\/strong> in the <strong>resources\/views <\/strong>directory and save the following code.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&amp;lt;!DOCTYPE html&amp;gt;\r\n&amp;lt;html lang=&quot;en&quot;&amp;gt;\r\n    &amp;lt;body&amp;gt;\r\n        &amp;lt;p&amp;gt;&amp;lt;?php echo 'My name is '.$name ?&amp;gt;&amp;lt;\/p&amp;gt;\r\n    &amp;lt;\/body&amp;gt;\r\n&amp;lt;\/html&amp;gt;\r\n<\/pre>\n<p><strong>Step 2:<\/strong> Add the following code segment in the <strong>routes\/web.php<\/strong> file to register a new route.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">Route::get('\/user', function () {\r\n    return view('user', &#x5B;'name' =&amp;gt; 'John']);\r\n});\r\n<\/pre>\n<p><strong>Step 3:<\/strong> Visit the <strong>URL: http:\/\/127.0.0.1:8000\/user <\/strong>to see the output.<\/p>\n<p><strong>Step 4:<\/strong> The following screenshot shows the output.<\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/passing-data-to-views-output.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-138664\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/passing-data-to-views-output.png\" alt=\"passing data to views (output)\" width=\"251\" height=\"97\" \/><\/a><\/p>\n<h3>Introduction To Blade Templates<\/h3>\n<p>Blade templates use <strong>.blade.php <\/strong>extension. The blade templates stored in the <strong>resources\/views <\/strong>directory.<\/p>\n<p><strong><span style=\"color: #ff6600;\">Usage of Blade Templates<\/span><\/strong><\/p>\n<ul>\n<li><strong>Usage 1: variable values<\/strong><\/li>\n<\/ul>\n<p>In blade templates, we can use <strong>{{ $variable }}<\/strong> to print the value of a variable instead of <strong>&lt;?php echo $variable ?&gt;<\/strong> As you see, there is <strong>no<\/strong> need to write <strong>PHP tags<\/strong> or the <strong>echo<\/strong> keyword.<\/p>\n<p>Let\u2019s do an example!<\/p>\n<p>Earlier, we created the <strong>user.php<\/strong> file using the following code.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&amp;lt;!DOCTYPE html&amp;gt;\r\n&amp;lt;html lang=&quot;en&quot;&amp;gt;\r\n    &amp;lt;body&amp;gt;\r\n        &amp;lt;p&amp;gt;&amp;lt;?php echo 'My name is '.$name ?&amp;gt;&amp;lt;\/p&amp;gt;\r\n    &amp;lt;\/body&amp;gt;\r\n&amp;lt;\/html&amp;gt;\r\n<\/pre>\n<p><strong>Step 1:<\/strong> Rename the file <strong>user.php<\/strong> to <strong>user.blade.php<\/strong> (in the <strong>resources\/views <\/strong>directory) and modify the existing code as shown below.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&amp;lt;!DOCTYPE html&amp;gt;\r\n&amp;lt;html lang=&quot;en&quot;&amp;gt;\r\n    &amp;lt;body&amp;gt;\r\n        &amp;lt;p&amp;gt;My name is {{ $name }}&amp;lt;\/p&amp;gt;\r\n    &amp;lt;\/body&amp;gt;\r\n&amp;lt;\/html&amp;gt;\r\n<\/pre>\n<p><strong>Step 2:<\/strong> Visit the <strong>URL: http:\/\/127.0.0.1:8000\/user<\/strong>.<\/p>\n<p>You will get the same output as the previous example as shown below.<\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/passing-data-to-views-output.png\"><img decoding=\"async\" class=\"alignnone wp-image-138664 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2020\/08\/passing-data-to-views-output.png\" alt=\"Usage 1 \u2013 variable values\" width=\"251\" height=\"97\" \/><\/a><\/p>\n<ul>\n<li><strong>Usage 2: ternary operators<\/strong><\/li>\n<\/ul>\n<p>In blade templates, we can use<strong> {{ $variable or \u2018default_value\u2019 }}<\/strong> instead of <strong>&lt;?phpisset($variable) ?<\/strong> <strong>$variable : ?default_value? ?&gt;<\/strong> to write ternary operators.<\/p>\n<h2>Conclusion<\/h2>\n<p>The<strong> Laravel<\/strong> <strong>Framework<\/strong> is a popular, free, and open-source MVC based web framework for PHP. It is used to develop complex PHP web applications. In Laravel, registered routes direct the request to the relevant function of the controller. Then the controller communicates with the relevant model, if necessary, and loads the view to display the content for the user.<\/p>\n<p>Middleware acts as a bridge between a request and a response. Laravel uses a special concept called Blade to design a unique layout to display data, and it can be used by other views.<\/p>\n<p>We hope you found this Laravel tutorial helpful! In the next <strong>Laravel Tutorial<\/strong><strong>,<\/strong> we will discuss database related functions of Laravel.<\/p>\n<p><em><strong>Happy learning!<\/strong><\/em><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/laravel-database-migrations\/\"><strong>NEXT Tutorial &gt;&gt;<\/strong><\/a><\/p>\n\r\n\t\t\t<div id=\"daexthefup-container\"\r\n\t\t\t\tclass=\"daexthefup-container daexthefup-layout-stacked daexthefup-alignment-center\"\r\n\t\t\t\tdata-post-id=\"138641\">\r\n\r\n\t\t\t\t<div class=\"daexthefup-feedback\">\r\n\t\t\t\t\t<div class=\"daexthefup-text\">\r\n\t\t\t\t\t\t<h3 class=\"daexthefup-title\">Was this helpful?<\/h3>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div class=\"daexthefup-buttons-container\">\r\n\t\t\t\t\t\t<div class=\"daexthefup-buttons\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t<div class=\"daexthefup-yes daexthefup-button daexthefup-button-type-icon\" data-value=\"1\">\r\n\t\t\t\t\r\n                <svg>\r\n                    <defs>\r\n                        <style>.thumb-up-cls-1{fill:#c9c9c9;}.thumb-up-cls-2{fill:#e1e1e1;}.thumb-up-cls-3{fill:#676767;}<\/style>\r\n                    <\/defs>\r\n                    <g id=\"thumb_up\">\r\n                        <path class=\"thumb-up-cls-2 daexthefup-icon-circle\" d=\"m24,3c11.58,0,21,9.42,21,21s-9.42,21-21,21S3,35.58,3,24,12.42,3,24,3m0-1C11.85,2,2,11.85,2,24s9.85,22,22,22,22-9.85,22-22S36.15,2,24,2h0Z\" \/>\r\n                        <g>\r\n                            <rect class=\"thumb-up-cls-3 daexthefup-icon-secondary-color\" x=\"10\" y=\"20\" width=\"6\" height=\"15\" rx=\"1.5\" ry=\"1.5\" \/>\r\n                            <path class=\"thumb-up-cls-1 daexthefup-icon-primary-color\" d=\"m30.57,9.06l-.49-.1c-.81-.17-1.61.35-1.78,1.16l-5.3,11.74c-.17.81,3.16,1.61,3.97,1.78l1.96.41c.81.17,1.61-.35,1.78-1.16l2.18-10.27c.34-1.61-.7-3.21-2.31-3.56Z\" \/>\r\n                            <path class=\"thumb-up-cls-1 daexthefup-icon-primary-color\" d=\"m38.17,20h-18.67c-.83,0-1.5.67-1.5,1.5v12c0,.83.67,1.5,1.5,1.5h16.27c.71,0,1.33-.5,1.47-1.21l2.4-12c.19-.93-.53-1.8-1.47-1.8Z\" \/>\r\n                        <\/g>\r\n                    <\/g>\r\n                <\/svg>\t\t\t<\/div>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t<div class=\"daexthefup-no daexthefup-button daexthefup-button-type-icon\" data-value=\"0\">\r\n\t\t\t\t\r\n                <svg>\r\n                    <defs>\r\n                        <style>.thumb-down-cls-1{fill:#c9c9c9;}.thumb-down-cls-2{fill:#e1e1e1;}.thumb-down-cls-3{fill:#676767;}<\/style>\r\n                    <\/defs>\r\n                    <g id=\"thumb_down\">\r\n                        <path class=\"thumb-down-cls-2 daexthefup-icon-circle\" d=\"m24,3c11.58,0,21,9.42,21,21s-9.42,21-21,21S3,35.58,3,24,12.42,3,24,3m0-1C11.85,2,2,11.85,2,24s9.85,22,22,22,22-9.85,22-22S36.15,2,24,2h0Z\" \/>\r\n                        <g>\r\n                            <rect class=\"thumb-down-cls-3 daexthefup-icon-secondary-color\" x=\"10\" y=\"13\" width=\"6\" height=\"15\" rx=\"1.5\" ry=\"1.5\" \/>\r\n                            <path class=\"thumb-down-cls-1 daexthefup-icon-primary-color\" d=\"m30.57,38.94l-.49.1c-.81.17-1.61-.35-1.78-1.16l-5.3-11.74c-.17-.81,3.16-1.61,3.97-1.78l1.96-.41c.81-.17,1.61.35,1.78,1.16l2.18,10.27c.34,1.61-.7,3.21-2.31,3.56Z\" \/>\r\n                            <path class=\"thumb-down-cls-1 daexthefup-icon-primary-color\" d=\"m38.17,28h-18.67c-.83,0-1.5-.67-1.5-1.5v-12c0-.83.67-1.5,1.5-1.5h16.27c.71,0,1.33.5,1.47,1.21l2.4,12c.19.93-.53,1.8-1.47,1.8Z\" \/>\r\n                        <\/g>\r\n                    <\/g>\r\n                <\/svg>\t\t\t<\/div>\r\n\r\n\t\t\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\r\n\t\t\t\t<div class=\"daexthefup-comment\">\r\n\t\t\t\t\t<div class=\"daexthefup-comment-top-container\">\r\n\t\t\t\t\t\t<label id=\"daexthefup-comment-label\" class=\"daexthefup-comment-label\"><\/label>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"daexthefup-comment-character-counter-container\">\r\n\t\t\t\t\t\t\t\t<div id=\"daexthefup-comment-character-counter-number\"\r\n\t\t\t\t\t\t\t\t\tclass=\"daexthefup-comment-character-counter-number\"><\/div>\r\n\t\t\t\t\t\t\t\t<div class=\"daexthefup-comment-character-counter-text\"><\/div>\r\n\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<textarea id=\"daexthefup-comment-textarea\" class=\"daexthefup-comment-textarea\"\r\n\t\t\t\t\t\t\t\tplaceholder=\"Type your message\"\r\n\t\t\t\t\t\t\t\tmaxlength=\"\r\n\t\t\t\t\t\t\t\t400\t\t\t\t\t\t\t\t\t\"><\/textarea>\r\n\t\t\t\t\t<div class=\"daexthefup-comment-buttons-container\">\r\n\t\t\t\t\t\t<button class=\"daexthefup-comment-submit daexthefup-button\">Submit<\/button>\r\n\t\t\t\t\t\t<button class=\"daexthefup-comment-cancel daexthefup-button\">Cancel<\/button>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\r\n\t\t\t\t<div class=\"daexthefup-successful-submission-text\">Thanks for your feedback!<\/div>\r\n\r\n\t\t\t<\/div>\r\n\r\n\t\t\t","protected":false},"excerpt":{"rendered":"<p>This Laravel tutorial introduces the PHP Laravel Framework, explains what is Laravel, how to install it, MVC architecture, and various components: Laravel Framework is a free and open-source web framework for PHP. It is used to develop complex web applications. It is based on the Model-View-Controller (MVC) architectural design pattern. &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"PHP Laravel Tutorial for Beginners: What Is Laravel Framework\" class=\"read-more button\" href=\"https:\/\/www.softwaretestinghelp.com\/php-laravel-tutorial-for-beginners\/#more-138641\" aria-label=\"Read more about PHP Laravel Tutorial for Beginners: What Is Laravel Framework\">Read more<\/a><\/p>\n","protected":false},"author":9,"featured_media":138688,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_helpful_pro_status":1,"footnotes":""},"categories":[412],"tags":[],"class_list":{"0":"post-138641","1":"page","2":"type-page","3":"status-publish","4":"has-post-thumbnail","6":"category-php"},"acf":[],"_links":{"self":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages\/138641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/comments?post=138641"}],"version-history":[{"count":0,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages\/138641\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/media\/138688"}],"wp:attachment":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/media?parent=138641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/categories?post=138641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/tags?post=138641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}