Laravel 12 in 11 hours - Laravel for Beginners Full Course

The Codeholic www.youtube.com

Brief Summary

This YouTube video is a comprehensive Laravel for Beginners course, extracted from a premium course. It covers fundamental Laravel concepts, project setup, routing, controllers, views, database interactions with Eloquent ORM, and deployment considerations. The course aims to equip beginners with the skills to build and deploy Laravel applications.

  • Covers fundamental Laravel concepts for beginners.
  • Includes project setup, routing, controllers, and views.
  • Focuses on database interactions using Eloquent ORM.
  • Discusses deployment strategies and best practices.
  • Offers coupon codes within the video for free access to premium content.

Introduction

The author introduces a Laravel for Beginners course, comprising 37 modules and over 24 hours of content, including videos, written lessons, quizzes, and deployment guides. The first 19 modules are combined into a single, free YouTube video. The author encourages viewers to like, subscribe, and comment, noting the video includes time codes for easy navigation. The course is designed to be beginner-friendly, avoiding extra JS or CSS frameworks, and will be updated based on viewer feedback. The author also announces a new free Laravel React e-commerce website course and offers coupon codes within the video for free access to all courses on his website.

Prerequisites

The course is suitable for individuals with or without prior Laravel experience, but a solid grasp of PHP, object-oriented programming, HTML, CSS, and basic SQL database knowledge is recommended. Familiarity with tables, columns, primary and foreign keys, data types, queries, joins, and basic insert, update, and delete operations is beneficial.

Project Full Demo

The course project is a car selling website, grabacar.xyz, deployed in a production environment. The homepage features a hero slider with options for buyers and sellers, a search form, and the latest listed cars. Users can search by make, model, state, city, type, year, and price range. Car details pages include multiple images, detailed descriptions, and seller information. Potential buyers can view a partially visible phone number and click a button to reveal the full number via an Ajax request. Registered users can sign up or log in using email and password or social accounts like Google or Facebook. Authenticated users can add cars to their watch list, manage their profile details, and list their own cars for sale.

The Importance of Deployment

The author emphasizes the importance of deploying projects to a production environment to showcase them in a portfolio and provide a demo link. Custom domain deployment enhances professionalism and demonstrates the ability to take a project from start to finish. The course uses GitHub Actions for project deployment, and the author recommends Hostinger for hosting, citing its advantages such as domain purchasing, shared hosting, VPS hosting, cloud hosting, DNS settings management, and DDoS protection. A VPS server with a pre-installed Laravel application is used, and a special discount coupon code "learnlaravel" is provided for Hostinger.

Getting Started with Laravel

Laravel is introduced as a popular PHP framework known for its clean syntax and tools that simplify web application development. Key benefits include quick setup, security features like XSS and SQL injection protection, high performance, a flexible routing system, and the Eloquent ORM for database interactions. Laravel follows the MVC architecture, offers built-in testing support, authentication and authorization, caching, error handling, and the Blade templating engine. It also supports task scheduling, a robust queue system, multilingual support, and easy maintenance and updates.

Routing

The request lifecycle in Laravel starts with public/index.php, which loads the autoloader and creates the application. Service providers configure the application, and the router matches the request to a function, potentially executing middleware. The controller sends a response, possibly rendering a view. Configuration options are primarily in the .env file, with additional options in the config folder. To create a new route, the Route facade is used, specifying the HTTP method (e.g., get), URL, and associated function.

Controllers

A controller is a class associated with one or more routes, responsible for handling requests. Controllers group similar routes together, such as a ProductController for product-related logic. Controllers can be created manually or using the PHP artisan make:controller command. To associate a route with a controller action, an array is used specifying the controller class and method name. Multiple methods can be grouped under a single controller using Route::controller. Single action controllers, generated with the --invokable flag, have a single __invoke method that is executed when the controller is called. Resource controllers provide a convenient way to handle typical CRUD operations, with methods like index, create, store, show, edit, update, and destroy.

Views - The Basics

Views are files responsible for presentation logic, stored under the resources/views folder, typically in Blade format. Blade is a templating engine that mixes HTML with PHP using a clean syntax, supporting template inheritance, directives, and reusable components. Views can be created manually or using the PHP artisan make:view command. To render a view, the view function is used, specifying the view name, which can include subfolders using dot notation.

Views - Displaying Data

Data can be passed to views using an associative array as a second argument to the view function or using the with method. Variables are output in Blade files using double curly braces {{ $variable }}. Global shared data can be declared in a service provider using the View facade's share method, making it available in all Blade files. Functions and classes can also be used within Blade files to output data. Variables are escaped by default to prevent XSS, but unescaped output can be achieved using double exclamation marks {{!! $variable !!}}. To prevent Blade from processing certain expressions, the @ symbol is used, and the @verbatim directive can be used to ignore entire sections.

Views - Blade Directives

Blade directives are special keywords prefixed with @ used in Laravel's templating engine to simplify common tasks. Directives are converted into plain PHP code, enhancing readability and maintainability. Common directives include @if, @for, @foreach, @extends, and @include. Comments in Blade are defined using {{-- comment --}}, which are not visible in the page source. Conditional directives like @if, @elseif, and @else are used for conditional rendering. The @unless directive is the opposite of @if. Other directives include @isset, @empty, @auth, @guest, and @switch. Loop directives include @for, @foreach, @forelse, and @while. Continue and break directives can be used within loops.

Website Layout with Template Inheritance

Template inheritance in Blade allows defining a base layout and extending it in other views. The @extends directive specifies the layout to inherit, and @section and @yield are used to define and output content sections. The @show directive defines a section and immediately outputs its content. The @parent directive includes the content of the parent section. The @hasSection directive checks if a section is defined. The @checked, @disabled, @readonly, @required, and @selected directives conditionally add HTML attributes.

Components

Components are reusable pieces of user interface that encapsulate HTML markup, styles, and logic. Laravel supports class-based and anonymous components. Anonymous components are Blade files located under a specific folder inside resources/views. They are included using HTML tags starting with x-. Components can be nested in subfolders, with the folder structure reflected in the tag name (e.g., x-admin.card). Components can use slots to insert custom content, with default slots using the $slot variable and named slots using <x-slot> tags. Class-based components have a corresponding PHP class that defines the component's logic and data.

Create Basic Pages

The video transitions to building the car selling website, starting with creating a HomeController and associating it with the homepage route. The welcome Blade file is deleted, and a hardcoded "index" text is returned from the index method of the HomeController.

Introduction to Databases

Laravel supports various databases, including MariaDB, MySQL, PostgreSQL, SQLite, and SQL Server. Database configurations are located in config/database.php, with the default connection name taken from the .env file. The .env file specifies database credentials, and the database driver is set to SQLite by default.

Migrations

Migrations are used to manage and version control the database schema, allowing for creating, modifying, and sharing database changes. Migration files are located under database/migrations and consist of a timestamp followed by a descriptive name. Each migration file contains an anonymous class extending the Migration class, with up and down methods to apply and revert changes, respectively.

Eloquent ORM Basics

Eloquent ORM (Object-Relational Mapping) allows interacting with databases using PHP objects rather than raw SQL queries. Each database table has a corresponding model, located under app/Models, which extends the Illuminate\Database\Eloquent\Model class. Models provide methods for CRUD operations and support relationships between tables.

Eloquent ORM Relationships

Eloquent ORM relationships define how different database tables are related, including one-to-one, one-to-many, and many-to-many relationships. Relationships are defined as methods in the model classes using methods like hasOne, hasMany, belongsTo, and belongsToMany.

Factories

Factories generate fake data for models, aiding in testing and seeding. Factories are located in the database/factories directory and extend the Illuminate\Database\Eloquent\Factories\Factory class. The definition method returns an associative array of attributes and their fake values.

Data Seeding

Seeders populate the database with sample and test data, defined in the database/seeders directory. Seeders are run using the PHP artisan db:seed command and can call other seeders. The run method in a seeder class defines the data insertion logic.

Output Data on the Website from the Database

The video demonstrates how to retrieve data from the database and display it on the website. The Homecontroller is updated to select cars from the database and pass them to the index view. The index view is then modified to iterate over the cars and display their properties using Blade syntax.

Database Where Clause

The video covers various where clauses in Laravel's query builder, including multiple where clauses, orWhere, whereNot, whereAny, whereAll, whereBetween, whereNotBetween, whereNull, whereNotNull, whereIn, whereNotIn, whereDate, whereMonth, whereDay, whereYear, whereTime, and whereColumn.

Data Pagination

Pagination is implemented using the paginate method on the query builder, which automatically handles setting the limit and offset. The links method is used to render pagination links in the view. The default pagination view can be customized by publishing the vendor pagination views and modifying the Tailwind CSS template.

Requests & Responses

The video discusses how to access request data and return responses in Laravel. Request data can be accessed by accepting a Request instance in the controller method or using the request() global function. Various methods are available on the Request object to access URL, method, headers, and other request information. Responses can be returned using the response() helper, allowing for setting status codes, headers, and content types. Redirects can be implemented using the redirect() helper, specifying the URL or route name to redirect to.

Outro

The video concludes with a thank you message and encouragement to explore the complete course on the author's website.

Summarize any YouTube video in seconds

Get summaries like this one for any video, in your language, with the free Summ app.

Download on the App Store
Get it on Google Play

Transcript

Full transcript of “Laravel 12 in 11 hours - Laravel for Beginners Full Course”. Click a timestamp to open the video at that moment. Need another video? Use the YouTube transcript generator.

0:00 I recently have released Lal for beginners course on my website the cool.com that course contains 37 modules 24 plus hours of content more than 300 well prepared well-edited HD videos written lessons quizzes and challenges deployment on custom domain on VPS server with GitHub actions certificate of completion and a lot more today I took first 19 modules of my premium course combine that into a single video and offering this to you for free on my YouTube channel the only thing I ask is like subscribe and provide a nice comment the video has a Time codes for pretty much every lesson if you want to skip around you can do this I have one very important and big announcement to

0:45 make in this introduction section so please don't skip that section and watch it till the end I tried to make the course Very beginner friendly so I didn't not use any extra JS or css Frameworks during this course even the HTML CSS template which I created exclusively for this course is pure HTML and CSS and JavaScript template no extra Frameworks there we will just work with LL and blade templates and of course database and a lot of other things do you get my point right anyway I plan to update the course from time to time trying to make this literally the best Lal 4 beginners course out there and for this I need your feedback whether you're watching this on YouTube channel or on my website C .c if you have anything in

1:31 your mind you can write them under the comment section down below and I will do my best to read every comment and react accordingly on those comments if you are enrolled in this course you can provide your feedback on the Discord group as well the course also has 400 Pages written notes for pretty much every lesson from time to time as I update my course I will update that written notes as well on the course page or on my website you can find the newsletter subscription form if you want to get the course updates or PDF updates or releases about new courses please subscribe to the newsletter I promise you won't be spammed you will be only notified with meaningful and useful information for you before we jump into the course two more things I want to mention first is that I'm right now working on one of the most exciting project I have ever built and this is

2:18 going to be available on my YouTube channel for free and this is Lal react e-commerce website that course will use the latest Lal version react uh with inertia version two and service side rendering spatia roles and permissions package it's going to have multiple vendors online payments and it's going to have a lot of comprehensive e-commerce features such as product variants Dynamic Fields coupon codes and discounts watch list reviews and a lot more follow me on EX or Twitter because I share updates regarding this course from time to time and also don't forget to subscribe to be the first one to be notified when the course is released and now here's the exciting news I wanted to give a chance to every student who wants to enroll to my courses but cannot

3:04 afford them so this is what I decided in every video I'm going to generate 100% coupon code for all the products that I have right now created on my website and right now there are three products Lal course for beginners which is what I'm talking about right now the offline written notes for this Lal course for beginners which is 400 page PDF file and laravel vue.js e-commerce website as soon as you find the coupon code you can use that coupon code to purchase all my three products and in this specific video there are two such coupon codes and though the location of these coupon codes are absolutely random so you see

3:51 that this is 11 hours tutorial somewhere in this um tutorial there are two coupon codes using which you can purchase all three prod products that I have right now available in order to find the coupon code you need to watch the video or scheme the video find the location and as soon as you find the coupon code you can use that you can uh just go through the checkout process on my website you can put the coupon code there and purchase for free you can enroll for free it's a 100% coupon code I want to highlight that uh but also send me a DM on X so please let me know once you find the coupon code because I want to announce this as soon as you somebody finds that on my Twitter account or ex because I want to let everyone know that the coupon codes are

4:37 already found for this specific video so for this please follow me on Twitter as well and send me DM if you find the coupon code if you're the lucky one to find that I'm I'm very happy for you um but yeah this is all I wanted to say and this happens on almost all the videos I release from now on so in every upcoming videos there will be at least one coupon code one is going to be kind of minimum but today because this is a special video for me um I decided to put two coupon codes yeah that's what what I wanted to mention and now enjoy the video Welcome to my leral course for

5:23 absolute beginers in this course we will learn all the fundamental topics of Lal and build fully functional car selling website where you can browse cars for sale filter by multiple criteria such as make model release yard price car type and so on you can see car details page with multiple images detailed description and features of the car in case you are interested buying the specific car you can view the owner's full phone number if you want to sell your own car you can sign up or login with email and password or with social out such as Google or Facebook you can add your own car upload images and publish on the website at the end of the course I will also teach you how to host

6:08 the project on custom domain in production environment just type in your browser grab a car doxyz and see the final version of the project at the end of each module you will also find quizzes and challenges to test your skills the course also includes written notes for almost all the topics that is explained in video content this course also has 3 hours testing section we're going to get familiar writing test in LEL and write all the necessary and useful tests for our project by the end of this course you will be able to confidently build Lal projects with this complexity and host it on custom domain the course also comes with 30 days money back guarantee if you don't like it we

6:54 will refund your money back hello everyone my name is Zur also know known as the code holic I taught to hundreds of thousands of students what is PHP and how they can create fullstack applications with PHP and L I'm super excited to be your Mentor in this course and let's get [Music] started this course is the perfect course for everyone whether you have zero experience with Lal or you know your way around round and you want to take your Lal skills to the next level since Lal is built on PHP it's important you to have solid grasp of PHP and

7:40 objectoriented programming don't worry you don't need to be an expert just comfortable enough to understand the basics you also need good handle of HTML and CSS since they are essential part of building websites knowing how to structure a page with HTML and style it with CSS is all what you need need lastly we will be working with databases a lot Reading Writing inserting updating the data so having a basic understanding of SQL databases will help a lot you should know what tables columns primary Keys foreign Keys data types are along with how to run queries write joints and perform basic insert update and delete operations again no need to be an expert

8:26 just Basics will be enough now let's have a look at the full demo of the project we are going to build in this course you can also check this on your own computer just type in the browser grab a car. XYZ this is already deployed on production environment when you open the homepage you're going to see hero slider right here then search section and then latest edit cars in this hero section we see two main slides one is for potential buyers and second is for potential sellers this search form is just basic search form we can search by maker model state city type ER range price range and fuel type and when

9:14 we click on search right here this is going to open dedicated search page and on the left side we have even more search criterias let me go back and check the homepage on the homepage we see 30 latest eded cars we can see car's primary image its location its yard maker model and price the type and the fuel type as well when we click on the car it is going to open car details page right here we see all the images of this car and we can just activate the image by clicking on the thumbnail or we can navigate into the images through these arrows on the right side we see the price and all the details about this car we also have right here the seller information who is selling that specific

9:59 car we can also see that this seller has 26 total cars open for selling right here we have the phone number if you as a potential buyer are interested to buy this specific car you can contact to this buyer um on this phone number however the phone number if you pay attention is not fully visible that is done on purpose we didn't want the phone to be always fully visible because search engines will crawl our website and they will just grab grab the phone number and use it for spamming purposes instead if you are interested to see the full phone number you can click on this button this is going to make Ajax request to the server get the full phone number and display this right here so

10:45 here we also have detailed description of the car and car specifications all the features the car U has supported if we scroll at the top we see right here heart icon this is to add the car into your watch list into your favorite cars right now I am not authenticated and if I click this watch list I get the following message please authenticate first to add cars into watch list okay let's try to add this car into my favorite cars when I am authenticated now let's test everything from the sellers perspective I'm going to click on sign up right here we have the very basic form with a name email phone and password we have also possibility to sign up with Google and

11:31 Facebook let's sign up with Google I'm going to click on this then I'm going to choose the account using which I want to sign up and I am actually already signed up and it opens this a new car page right now because I'm already authenticated let's open the homepage I'm going to scroll down below and I'm going to add this car into my favorite cars right now I get the message car was added to watch list let's click okay now right here I have my profile section so I can see my personal details like name email phone and I can change the password right here the email is disabled this is because I am authenticated as Google user and I cannot change email if I am

12:16 authenticated as Google user if you are authenticated as regular user with email and password you can change your email let's check my car section and at the moment my user doesn't have any cars I can click right here to add new one but I'm interested in my favorite cars section inside which I have only one car at the moment let me go ahead and add a few more cars I'm interested into this one okay and into this one as well okay awesome now let's click on my favorite cars and I see all three cars and the latest added car is at the top of the list okay I'm not interested in this one I'm just going to remove it I can reload the page and this is gone if I have a lot of cars added into my favorite cars

13:03 list then right here I will see pagination now let me try to authenticate with a different user which has cars inside my car section and we can try to add new car from there I'm going to log out click on login I'm going to click on login right here okay and welcome back Ila Graham now let's check my car section and I have right here a lot of cars and right here I also see this pagination okay let's let me try to add new car click right here I'm going to choose Lexus RX ER we're going to choose car type let's provide some price here let's provide the VIN code which must be exactly 17 characters so for justed

13:48 testing purposes I'm just going to type right here one one one let's provide the millage let's provide the fuel type we're going to choose the location we're going to provide the address as well we're going to provide address as well phone number and we're going to choose the features the car has supported I'm going to take couple of features not all of them we're going to provide right here some description let's provide test description and if we want to publish the car and make it available for selling we're going to provide the publish date right here we can also provide the publish date in the future and then the car will be visible on the website in the future but not now if we just want to create CS but not publish them you can just leave this publish date as empty right now I want the card

14:35 to be displayed on the website so I'm going to choose today as publish date and before I click on the submit let's add images as well that's good let's click on submit the car was added and we see right here this new car we can click on the homepage scroll down below and we see uh right here the new car has been added now let's try to edit this car I'm going to click on my cars we can click on edit we can change anything what we want however if we want to manage images for the specific car we cannot do this from the screen we can click right here or we can click images button from here in the my cars page I'm going to click on images and right here we have couple of options

15:21 we can delete the images we don't want let's say I don't want this image so I'm going to tick this under the delete column and I'm going to click this update images and that image was actually deleted I can also change the ordering let's say I want this image to be the first one so I'm going to give it position one and I'm going to give this position three I'm going to click on update images that was updated now this is the first one and if I check the homepage we're going to see that this image now is the first image kind of thumbnail image of the car let's go back into images if we decide that we want to add more images to that car we can click right here choose a few more right now we will have duplicated images but

16:06 that's not important and click on ADD images right now we have more images on this car let's go on the homepage click on the car and we see all the images that we added for that specific car before we dive deep into larel I want to talk to you about something super important important and this is deployment now I know for many developers this seems something like they can put off for later stage but trust me learning how to deploy your project on production environment and make it accessible to the world is a GameChanger imagine this you have worked very hard created cool application with some cool and nice features and you want

16:51 to put this project in portfolio and you want to demonstrate this to everyone how you're going to do this of course you can write text descriptions you can also put some screenshots of the application in the portfolio but would not it be even better if you just deploy the project and put a demo link of the project in your portfolio having a demo link of your project is such a powerful tool now it is not just your words about the project it is a real actual functioning application that anyone can see when I personally look for some projects to use for my personal purposes I always look for projects which have demo links because one thing is what they say about the project how the screenshots look but the other thing is

17:38 how it actually works when you make your hands on the project deploying the project on your own custom domain gives it professional look and touch as well it shows that you can take the project from start to finish and make it accessible to anyone and anywhere and this is exactly what we are going to do in this course we will be using GitHub actions for the project deployment which means less hustle for you once we set the project up your updates will be deployed immediately it is like a magic now speaking about hosting and deployment I personally use hostinger and they have been great so far I have been using their services for past three or four years and I'm very happy and confident that I can recommend it to you as well alongside with great advantages

18:25 of the hostinger one of the greatest Advantage I personally like is that I have a single space from which I can purchase domains I can purchase shared hosting VPS hosting Cloud hosting I can manage DNS settings I can purchase business emails for my websites in my case this is going to be info@ grab card. XYZ um or support at grab a card. XYZ or both at the same time and hostinger also provides D protection with cloudware from their panel I don't have to switch back and forth between multiple accounts one for domain second for hosting third for dust protection or DNS management everything is in a single place which is pretty cool for me and this saves a lot of time for me as well shared hosting is great for small projects and if the projects do not need

19:12 any big customizations I can use shared hosting for a very low price which includes domain SSL certificates databases 100 website support and a lot more I do have YouTube videos where I deploy my Lal projects on shared hosting and I can tell you that this is is not bad practice but you should always keep in mind that shered hosting has shared Resources with others so that's good for small projects but not for the big ones for medium to large size of projects I generally grab a VPS server and this is what I recommend also which comes with the latest pre-installed Lal application and set up everything the engine server the MySQL databas is the cloud panel to manage everything on your server and simply I can replace the existing prein

19:58 Lal application with mine for this project we're going to get VPS server and purchase the domain for as low as $2 all inside the hostinger they have all the tools you need to set the project up very easily and I will show you stepbystep guide how you can make your Lal project up and running on their platform for this course I partnered up with hostinger and they were kind enough to provide me the VPS server on which I'm going to host my project they also provided special link in discount coupon code for the students of this course or for pretty much anyone who wants to learn Lal go to the following URL hostinger.com learn Lal grab the VPS hosting you want and during checkout use a coupon code learn Lal to get extra 10%

20:46 off so by the end of this course you will not only know how to create fully working Lal applications but also how to deploy this on custom domain on production environment make it accessible to to the world which is an awesome skill to have and it's going to boost your confidence as well all right let's get started lateral hands down is the most popular PHP framework out there used for almost everything starting from simple websites to apis crms e-commerce systems and just about any kind of web application you can think it was created by Taylor otwell in

21:31 2011 and right now is developed and maintained by an amazing team of passionate web developers laravel is all about clean and elegant syntax it provides a lot of tools to make building modern and robust web applications easier and more enjoyable LL offers ton of benefits so let's take a look at few of these standout features it's quick and simple to get started with but powerful enough to handle complex applications security is right in with features like xss protection and protection against SQL injection it delivers high performance right out of the box laravel's rooting system is super flexible and Powerful eloquent orm

22:18 makes working with a databases a breeze the syntax is clean simple and elegant making coding more enjoyable it follows the MVC architecture for better structure structure and organization LL comes with built-in support for testing which is a huge plus authentication and authorization are already baked into the framework caching is made easy for better performance it offers excellent error and exception handling the blade templating engine helps you build Dynamic frontend effortlessly task scheduling is seamless making automated tasks a breeze it has a robust QE system for managing heavy background jobs need

23:03 to support multiple languages Lal got you covered with multilingual support maintenance and updates are super easy it keeps costs low while providing tons of value and let's not forget huge laral community and ecosystem there is a package for just about anything you can think of these are just few benefits of using l the more time you spend in LL the better you will understand how powerful the framework is if you are here on this course willing to learn Lal I assume that you already have some experience in PHP and you quite probably have PHP working

23:49 environment setup locally here are two major options in terms of Lal working environment setup if you are on Windows or on Ma Mech you can set up your laravel working environment using laravel herd laravel herd is a single program which combines PHP engine X web server node.js and composer if you buy a pro version of this package it is going to include MySQL radi and few other useful Services as well the second option to set up your PHP working environment is called zamp zamp is a package which contains PHP Apache web server MySQL and few other services if you choose zamp as a choice of your PHP environment you have to install composer

24:36 and node.js separately which is a disadvantage compared to herd another disadvantage of zamp is that at the moment it doesn't have the latest version of PHP supported in the future this might change and it might support the latest version of PHP but Lal herd already supports PHP 8.3 however the ADV Vantage of zamp is that it supports MySQL and comes with PHP my admin as well in case of her MySQL is in pro version so you cannot get it for free you can choose whichever you want herd or zamp if you're on Linux you might install PHP apach your engine and MySQL as separate packages but we will not need MySQL engine or apachi locally

25:23 installed for this course as we are going to use sqlite as a choice of the database and we are going to start the project with php's built-in server but my choice for this course is going to be LEL herd just because it has the latest version of PHP 8.3 at the moment in case of Lal herd before you install your Lal project we should make one change in PHP in we are going to open a folder inside which PHP in file is located this in my case is located in my home directory under config folder heard being PHP and the version of the PHP in this folder there is PHP in file located and we're

26:08 going to open this using any editor you want we're going to find variables order text and we're going to remove this e and change this e gpcs into just gpcs we can close this file then we're going to open any terminal and we're going to execute her restart to take the changes of PHP speaking about the editor/ ID for Lal there are two major players PHP storm and vs code PHP storm is the paid product but is the best choice in my personal opinion for PHP it has integrated all the tools you need for laravel or PHP development it has 30 days free trial as well so I really

26:54 recommend to try it vs code is free and open source but you need to install a couple of extensions to make it convenient for Lal development one of the extension is PHP allinone extension this contains all the basic things you need on PHP such as syntax highlighting Auto completion formatting and so on the next extension I recommend is LL blade Snippets I also recommend to install LL goto view leral extra intelligence and leral blade formater this extensions in my opinion are the most basic extensions you need to install in vs code to make it convenient to work with

27:40 LL there are several ways to create Lal projects locally one of them is to install using composer comment we're going to execute composer create d project ll/ Lal and we're going to provide here your project name the second option is to install Lal installer and create new project with Lal installer keep in mind that internally it still uses composer to install Lal installer globally we're going to execute composer Global require ll/ installer once this comment is finished we can create new Lal projects using Lal new and our project name the

28:30 third option to create Lal project locally is using Lal herd if we go into side section we have a plus button right here when we click on this we have three options no starter kit leral Breeze and Jetstream we can choose whichever we want we're going to click next we're going to provide right here our project name we're going to choose the testing framework we're going to choose the Target location and we're going to click next it is going to start creating project locally and once this is done we're going to have up and running Lal project the Lal project has been created using Lal herd but I am going to delete this because this is not the way I want to create my

29:17 Lal project maybe you are following this on zamp or you have a separate environment on Linux separate installation of PHP and everything so we're going to create Lal project using terminal I'm going to navigate into desktop folder and I'm going to execute Lal new Lal course right here on the first question I have three options I'm going to hit the enter I'm going to choose the default one no starter kit and I'm going to hit enter right here as well now it asks us which database we want to use and I'm going to leave this default as this is the SQ light and this is exactly what I'm going to use hit the enter right here the project has been installed and here we have the instructions we can navigate into the project and we're going to execute PHP

30:02 Artisan serve but before I do this I want to open this project using my editor or ID the project is on my desktop as we created that I'm going to open brand new install PHP store and I'm going to click open right here we're going to go to desktop and choose a lotel course we're going to trust this project the project has been opened and now I'm going to bring up terminal integrated terminal of PHP storm you can open integrated terminal of vs code as well we are inside the LEL course project and we're going to execute PHP Artisan serve now we're going to open 1271 Port 8,000 in our browser and we're

30:50 going to see Lal application up and running in Lal in art design is a command line tool that helps you to perform various tasks related to your web application such as generating code managing migrations clearing cache and more here's my project opened in PHP store and now I'm going to open Terminal in one terminal I have PHP Artisans running so I'm going to open second terminal in vs code you can open your terminal from the menu item terminal Al new terminal you can execute PHP Artis on serve right here and if you click the plus button it's going to create second terminal and

31:36 you can execute all the rest of the Artisan commments right here now let's go back to PHP storm and I'm going to open this terminal on a full screen every Artisan command should be executed using PHP Artisan this is a common line tool and this command will be followed specific Artisan command such as about when we hit the enter this is going to give me the all information every information about our project such as application name Lal version PHP version information about caches and drivers let's hold on for a second and understand how this works there is a file in our project which is called Artisan it doesn't have any extension but actually this is a PHP file it is

32:24 using the following class to pass the arguments in our console it is loading all the autoload files from vendor folder right here it is creating the Lal application and calling handle command passing the new argument input instance the rest happens inside this handle command and inside this application class to get the list of all available commments in our terminal we are going to execute PHP Artisan list we can scroll up and we see dozens of comments right here here some of the commments are inside the group such as cache DB event or make every comment right here has its own description what it does

33:10 okay to see a list of commments in a specific group we're going to execute PHP artisan make which is the name of the group help which means that I want to get all the commments inside make group or make name space when we hit the enter it's going to give me all the commments available for the make name space to get information for a specific command such as make controller we're going to execute the following commment PHP artisan make controller d-el we hit the enter and we're going to see the description of the commment the usage how we can use it arguments as well as all the additional options with

33:57 the description for each option so whenever you have a question how a specific command Works in Artisan you can always execute PHP Artisan that command D- [Music] help now let me give you a challenge I want you to execute an artisan command which will give you list of all the available commments in a q namespace pause the video right now execute that Artisan comment and then continue the video and see the [Music] answer okay to get a list of all commments in a q name space we're going

34:43 to execute PHP Artisan Q help we hit the enter and it's going to give us all the available comments or the Q name space as well as the descriptions for each comment now I have another small challenge to you now let's execute an artisan command which will give you all the information about migrate colum refresh commment okay I hope that was easy to get all the information about migrate refresh commment we're going to execute PHP Artisan migrate colon refresh D- help we hit the enter and it's going to give us the description the usage as well as all the options with their

35:28 description regarding that specific comment now let's explore directory structure of our lateral application there are several key folders in your Lal application inside which you are going to do most of your work one of them is the app folder by default it contains HTTP moduls and providers folder containing controllers models and a single provider but you can also create new folders manually inside the app folder such as enam for example and create new enams inside the enam folder and it's going to be autoloaded or whenever you execute specific Artisan

36:13 comments such as PHP artisan make job is going to create job folder for you inside app folder bootstop folder contains two main files a PHP and providers PHP a PHP file is one of the most important files inside which we can configure middle weers routing exceptions and few other useful things around our application providers PHP just contains a single provider you can add more providers inside this array config folder contains the major configuration files if you don't plan to modify these configuration files you can delete them or if you want to create new configuration files you can also create them either by manually or by executing

37:00 specific Artisan command the database folder contains factories migrations and sits this will also contain database.sql file if your database driver is set to sq light in our case we are using SQ light as our choice of database that's why we see right here database SQ light this is the main database file for our project public folder is single web accessible folder index PHP right here is the entry script and the request starts from this index PHP so every file or folder which is available inside public folder is going to be accessible through the browser resources folder contains CSS JavaScript and Views RS

37:48 folder contains the main rots for our application whether those are web based roads or console based roads if if we decide to create API roads we can have api.php for roads related to API storage is the folder that contains all the generated files inside app folder we can have uploaded files by the user inside the framework there are files and folders generated by the Lal framework itself such as cache sessions testing or views those views are cached views the locks folder contains all the log files generated by Lal framework test folder contains all the available tests vendor

38:34 folder contains all the third party packages editor config file is necessary for IDE or editor file contains most of the configuration options around our application such as the application name application language database credentials session driver RIS client mailer SMTP credentials and so on enf do example file is the simple example file of you should never comit and push file in your git repository because it might contain sensitive data instead you're going to comment and push. example file which should not contain sensitive data it should contain only sample data git attributes and git

39:19 ignore are git related files we already talked about Artisan composer Json and composer log are composer related files package Json is for mpm dependencies PHP unit is for test read me is I think obvious and V config JS is the configuration file for V server now I want to create new route whenever I access slab URL in our application I want to see um some text some information about my project so let's go to the project and we're going to open Roots folder web PHP and we are

40:05 going to create new root for slab for this we're going to use root facade we're going to listen on get method the URL is going to be about and we're going to provide function right here from which we are going to return view in inside view we're going to pass the actual view name in our case I'm going to create a view called about we need semicolon here semicolon here now if I try to access slab root is available but we don't have view yet let's go inside resources views and just

40:51 like here we have welcome blade PHP I'm going to create another blade PHP file about. blade PHP file let's hit the enter the blade file can contain plain HTML even plain HTML is okay we're going to obviously talk more about blade in the future lessons but for now let's just create H1 tag right here and I'm going to write hello welcome to my LEL course and let's create another paragraph I'm going to just write low mum text now when I save this I go in the browser reload the page and we're going to see hello welcome to my Lal course with some Laur msum text

41:38 congratulations you have just created your first Lal [Music] route in leral application the request starts on public index PHP index PHP includes wender out toold PHP file then it creates application in bootup PHP the application itself loads configuration files and initiates service providers service providers in Lal prepare and configure the application handling tasks like registering Services event listeners middle wear and Roots they ensure both core and custom features are set up properly making the application ready to function efficiently then the

42:27 request is passed to router the router takes the request finds the corresponding function to execute and executes that optionally there might be middle we registered on the road we will talk more about middle weers but in a nutshell the purpose of the middle we is to execute code before the request reaches to the action and maybe block the request after this the controller will send the response back to the user or if the middle we is registered the response will be passed to Middle we first and then returned to the user the controller action might also optionally render The View after which the response as a view will be sent to the browser in some cases the road might be configured

43:14 in a way that it directly renders the view in which case the response might be directly sent to the user or if the middle we is available first the response will be passed back to Middle we and then back to user this is the Lal request life [Music] cycle most of the configuration options regarding LL is available in file here you can change the application name application time zone change the language change the database credentials session driver modify rist client information SMTP details AWS and so on they are are even more configuration

43:59 Keys available which is not by default in the file if you want to customize configuration options which are not available inen file you can find the configuration files under config folder if you don't plan to modify these configuration files feel free to delete them the default files exist in Vendor folder in laravel core and they will be used from core let's open up PHP for example here we have the application name which is taken from file here we have the environment we have deug mode and so on now let's open database PHP configuration file we have couple of options right here and most of the values are coming from file but here we have one of the option which is called

44:46 migrations and here we have the table for example if you decide that you want to change the table name for migrations you should update that right here and if you don't plan to modify any other configuration options in this database PHP feel free to delete every other option right here and only leave migrations with your own database table name in this case the default values for those other configuration options will be taken from vendor from laravel core but your modified configuration option will be taken accordingly so if I quickly delete all the options right here just below the migrations and above we can have database.php file as simple

45:33 as that and of course modify the table name I'm going to undo this because this is not exactly what I want Let Me Close database PHP in a PHP and I'm going to open Terminal besides the configuration files that is available by default in the config folder there are other configuration files which is not available by default in the config folder but we can publish them and modify them to publish new configuration files we should execute the following Artisan commment PHP Artisan config publish when we hit the enter it's going to give us a list of configuration files we want to publish most of the configuration files are familiar for us and is already available in the config folder such as app for example but by

46:19 default broadcasting is not available in the config folder also course is not available in the config folder if I want to publish broadcasting configuration file I would just type right here broadcasting and hit the enter and the configuration file will be published or if you know exactly which configuration file you want to publish you can directly execute PHP artison config publish and the configuration file name for example course we hit the enter and we published course configuration file as well we can see those configuration files in our config folder broadcasting and course I just showed you how you can publish configuration files I don't need them to be published so I'm going to delete [Music]

47:08 them now let's talk about couple of useful debugging functions in Lille we have the welcome page opened and let's go and open roads web PHP file here we have two Roots defined and I'm going to make some changes right here I want to Define an associate creative array called person where we have this name and email and I want to print that person I'm going to use the following function called dump we're going to provide the person right here we save this and let's check in the browser and we're going to see a person like this dump is a Lal built-in function which prints every information about the given variable and it prints pretty nicely if

47:54 the associative array is too large you you can also collapse it and expand it and you can also see right here a comment from which file and which line that was printed there are two other debugging functions available one of them is called DD which actually prints the variable and stops code execution so if I reload right now we're going to see only this dump and we don't see welcome page anymore because right here the code execution was [Music] topped we have already defined a single Road in our application when we access slab about URL we see the following

48:40 content this is how we Define the TRU now let's see what other request methods are available in LL there are totally six request methods available get post put patch delete and option get is mostly used to get the information post is to create the information put is to update the information and Patch is also for to update the information delete is to delete the information and options is to get more information about the specific root in LL there is also a possibility to Define Roots which listen for multiple methods for example the following route will listen to get and

49:26 post methods and the corresponding function will be executed for both methods in the following way we can also Define a root which matches to all request methods if we want to define a redirect type of rout in Lal Roots we can do this in the following way we call the redirect method the first argument in this method is the rout to which we are going to listen to and the second argument is where the user should be redirected by default this redirect happens with status code 302 but we can also provide a third argument which is going to be the status code in this case we are doing a redirect with status code 301 which is the identical of calling

50:13 permanent redirect method in lateral there's also possibility to Define view type of rules for example the following code will listen to SL contact road and it will immediately try to render a view called Contact so if we open our application we can even change the following Road definition in the following way we can change this get into view we have the road as a first argument and the second argument in our case should be the view name we already have view called about so this will be the equivalent of what we had previously and now if I open the browser and reload the page we're going to see the same result optionally we can also provide

50:59 third argument to the view method and pass the parameters for view in this case we are passing a single parameter called the phone to the contact view in the later lessons we're going to see how we can get and how we can print those parameters inside the blade [Music] file now let's understand how to define roots with required parameters let's define a get root I'm going to listen to the following URL product slash and right here I want to have a variable Road parameter the road parameters needs to be inside curly braces so I'm going to Define curly braces and inside there I'm going to

51:46 give it a name I'm going to call it ID so whenever the URL looks like this then some function should be executed so here I have the function and whenever the function is executed it means that the URL was matched so we are going to get that ID as a parameter of the function once we have this ready we can already return something from here for example product ID equals the parameter ID okay now let's save this in open browser and let's access the URL product slash1 when we hit the enter we see the following text that text is exactly what is returned from here we can type right

52:32 here not only one uh we can type any arbitrary number obviously because this is a variable like 1 2 three or we can even have strings like test because we don't have any restriction defined on the following root for the root parameter ID so our defined Road will match the following URLs any string after the product textt if it does not contain forward slash will be matched now let's see slightly more complex example in this case I'm going to have three Road parameters let's say that I want to access product review for the specific language so in this case the URL the first section of the URL

53:19 contains the language code then we have the product as a hardcoded then we have the product ID then we have review text and the review ID so we have three variables and we can access those three variables inside this closure function we have length ID and reviews and the following Road will match the following URLs it's going to match these three URLs just pause right now and pay attention the variables at the moment can contain any arbitrary text as soon as these variables do not contain forward slash because forward slash is is a special character in the URL in the later lessons we will understand how to add those restrictions so that link ID

54:04 or review ID cannot be any arbitrary text now let's learn how to define rades with optional parameters let me Define get Ro in this case I'm going to listen to the following URL product SL in here I'm going to define a category parameter category but to make this optional we're going to provide question mark before this closing curly brace now let's provide Associated function here let's put a semicolon and inside this function we can obviously accept the category that's going to be string category but because

54:51 we Define that category right here optional this category might not be given to the fun function whenever it is not presented in the URL in order us to not have any kind of Errors we're going to assign some default value to the category okay in this case I'm going to assign null to it otherwise you might have an error when you do don't provide this category in the URL now I'm going to return something product for category equals the given category let's save this now let's open the browser and let's try to access the following Road product slash and let's provide the category let's say cars I'm going to hit the enter and we're going to see product for category cars however if we remove this section

55:39 completely it's going to still work however the category is going to be null that's why we don't see anything printed right here this is how you can Define the optional parameters and you can Define as many optional parameters as you want just make sure in the function us assign some default values to them otherwise if we simply remove these and reload in the browser we are going to see an error let's undo this and I'm going to leave null right [Music] here now let's define a road what we already had defined previously product slash ID and let's just return a text it works and I'm going to return the ID as

56:24 well as we already discussed if we provide any arbitrary text inside this ID variable it is going to work now let's open our browser and let's just provide product slash test we hit the enter and we see Works however our goal is to make it not working because we only want the ID to be number so if I type test we it should not work however if I type one two three any arbitrary number it should work how we're going to do this inside this road whenever we Define this after this calling this get method we can chain another method in this case I'm going to use the method

57:10 called we number we number accepts an argument and we're going to provide a parameter so in this case I'm going to provide it and that's it so we just Define that this rot should only work if the parameter ID is going to be number if I save this and reload in the browser we see it works however if I type test right here and hit the enter we see 404 the road was not matched that's the whole idea now let's see which URLs will be matched based on our road definition so the following Road definition will match the following URLs whenever the ID only contains numeric values it is going

57:56 to match but it is not going to match anything that does not contain numeric values now now let's see another example so we're going to define the following Road where username needs to contain only Alpha Characters it cannot contain numbers or anything else it should only be Alpha characters from A to Z so it is going to match the following URLs but it's not going to match the following URLs if the URL contains a numeric value okay let's see another example in this case I want the username to be to contain alpha numeric characters numbers and letters is okay but anything else is not okay so in this case it is going to

58:41 match the following URLs but it is not going to match the URLs which contains something else other than letter or number let's see another example I want to Define road with multiple parameters we have language and we have ID so in this case language can only contain uppercase and lowercase letters in the ID needs to contain only digits the road will match the following URLs however it is not going to match the following URLs let's see one last example in this case I'm going to Define list of allowed values so the language parameter can only be one of the provided values e n Ka a or i n in this case it is going to

59:27 match the following URLs but it will not match the following [Music] URLs we can also apply custom regex validation logic to our root parameters for example we have three Roots defined let's say that I want username to only contain lowercase letters not uppercase but only lowercase so in this case I'm going to Define right here here a we method I'm going to provide the parameter name in this case it is going to be username and then I'm going to provide the custom regex expression I'm going to define the following characters from A to Z and I'm using the plus sign

1:00:13 which identifies that the following characters needs to be at least one so now if I save this and I'm going to open the browser and let's try to access user slash Zur it is going to work and we see empty page we see empty page because we don't return anything from here however if I use any uppercase characters inside here let's say a is an uppercase I'm going to hit the enter I will see 404 because the rad was not matched in the same way we can Define custom reix validation Logic for other rootes so for example here I'm going to Define custom validation Logic for both parameters in which case I'm using an associative array

1:00:59 syntax the length needs to be exactly two characters any symbol from A to Z and let's use two character annotation however the ID needs to be digits let's make sure it is a digit and also we need to make sure that it is at least four characters length so four comma and curly brace this is a syntax of r reix if you don't know what is a regex how to work with it that is just out of scope of the following course but basically the following expression means that the ID needs to only contain digits but it should be also at least four characters now if I save this and let's try to access in the browser we are

1:01:45 going to have the following URL y/ product SL1 2 3 4 let's hit the enter and it's going to work and we see empty page because we don't return anything from here however if we change this language code and make it three characters it is not going to work and we see 404 or if we return this into two characters let's change this into Ka H but if we change this ID and make it three characters we're going to still see 404 because according to the definition it should be at least four characters now let's see the last example we are we Define the search let's try to access the following URL search SL test if we hit the enter we

1:02:33 see test right here because we are printing the search however if let's say that my search keyword should contain slash if I try to provide for example 9 divided by 15 and I hit the enter it's going to show me 404 because it tries to match the following URL and by default the Q parameter right here search does not consider SL character inside to make it consider SL character we're going to use the following validation rule where search cury parameter contains any symbol and it should be at least one character so I'm going to save this and now if I reload this we're going to see

1:03:19 nine divided by 15 in lateral we can also Define names for each rot but what is the point of assigning name to a rot here we have Slab Road which renders about blade file and we have just slash root which renderers welcome now let's imagine that we want to create a link to about page generally when we have a website we have the navigation and in the header we have the link to all the pages or most of the pages we might also have the link to the ab about page in the footer as well and maybe in the sidebar as well so a link

1:04:05 to about page is used in let's say three places and we want to change that URL so if we want to create let me create a variable called about page URL okay and we know that right now it is slab and whenever we use this about page URL it is going to be slab if we decide that we want to change the url from about into about us then we have to update all the places we have to update header we have to update footer and maybe if we have it in somewhere in the sidebar we have to update sidebar as well however if we associate name to

1:04:51 every road and we can associate names in the following way name and then we just provide right here some string in this case it's going to be logical if I call this about so we Associated name about to the about wrote and instead of having this hardcoded URL we can always generate the URLs with a name about page URL equals root and in this case we have to provide the root name in this case the root name is about now let's have a look if I comment this out and if I print this about page URL let's try to access homepage hit the enter we see a

1:05:37 about page URL this is it however if we decide to change the url from about into about us if we save this and reload the page we are going to see updated URL so the generation of the URL should always happen based on on the road's name that's why it is always good practice to associate names to your [Music] roads now let's define one more road which will have parameters product road with length and ID parameters I'm going to associate name product. view to the following quot now let's generate URL

1:06:23 based on the road name for the road which already has two parameters so first we're going to Define this product URL with the road and provide the product name then we're going to provide two parameters those are parameters which is required for the road Leng and ID we're going to provide Leng to be whatever and ID to be whatever in this case e and one now let's print this product URL but for this let's remove what we have right here completely now I'm going to save this and let's access in the browser I'm going to reload the page and we see the following URL now if I decide to change

1:07:10 the format of the URL let's say I want P slash language and then ID I save this I reload the page and this is how our URL looks like let me Define another rout and I'm going to call this user slash profile let's create a simple function empty function right here and I'm going to give it also name to be profile now I'm going to Define another rout which I'm going to call current user and let's say whenever current user is accessed I want to redirect user to the user profile page so in this case I want to do this redirect using the name

1:07:58 so one way to do this is going to use a redirect function and provide root right here and provide the root name in our case this is going to be profile the second way will be to use to root function just providing root name we can comment this out and just like this whenever we try to access SLC current user URL it is going to redirect us to a road which has name profile in our case this is going to be it if we want to Define roads with the same prefix we can do this in the

1:08:43 following way we can call the prefix on the road providing your desired prefix and then we're going to call group method on this providing the function inside that function we can Define our roads in a regular way however the prefix admin will be used for every road defined in this function so in our case the following rout will be matched if the URL is admin users if I save this and if we check in our browser we can see users is not going to be matched but admin SL users will be matched normally in the same way we can Define the prefix for the root name we're going to use

1:09:29 root name and the value is going to be admin dot in our case we provide the group and inside this function we're going to Define slash users root however I'm going to assign name to that road and this means that the URL is going to be matched with Slash users but the road name is going to be admin. users so if I save this any if we try to access slash users we are going to see these slash users however the road name is going to be admin. users typically when the road is not matched lateral will show 404 error for

1:10:16 example let's try to access SL contact we see 404 however we can define a fallback rout for every un Ed roads we can do this in the following way we're going to call fallback providing function right here which will be executed every time road is not matched so if I return right here fallback save and reload in the browser we see fallback right here in this case you can render any view maybe you want to save that information somewhere but the idea is that you can match all unmatched URLs with the fallback method [Music]

1:11:01 now let's open Terminal and I want to execute a command and print all defined Road list for this we're going to execute PHP Artisan Road list this will print six roads and two of them is defined by us slash and slout others are defined by a LEL application if we want to also display middle we for each Road we're going to provide flag DV we hit the enter and it is printing the middle we as well for each road if we want to only print roads which is defined by us we can provide D Dash except Dash vendor flag we hit the enter and it's going to print those two roads in a similar way

1:11:47 if we want to Define roads which is defined only inside the vendor we can provide only- vendor we hit the enter and it's going to print those four roads only if we want to Define all roads which are part of the API we can provide path equals API we hit the enter and in this case the application gives us an error that we don't have any rows matching the given criteria which is actually correct we can even combine these flxs and for example print all the details about our roads we can print them except vendor and we can even provide path equals admin for example this is not going to print anything because the given path

1:12:33 was not matched but I hope you get the idea once you deploy your Lal project on production it is recommended to execute the following command PHP Artisan wrot cach this will create cached version of your Lal roads is especially this is useful if your application has a lot of Roads the cache will help your application to match the road in a shorter time and this will increase the overall performance of your website however if you don't want this cach anymore you can clear this always by executing PHP Artisan Road [Music]

1:13:21 clear now let me give you a small challenge you should create a road which accepts two Road parameters these Road parameters must be numbers you should calculate the sum of these two parameters and print that sum pause right now spend some time to implement this then come back and see my [Music] solution all right now let's Define the root we're going to listen to the get method and let me call this sum and then we're going to accept two parameters A and B you can call this whatever you want then we need to define the function however I'm going to also

1:14:08 Define a validation Logic for these parameters we are number we are number and we can provide an array A and B both should be numbers then we're going to accept right here float a and Float B finally we are going to return some of these two numbers a plus b let's save this now let's open the browser and try to access to the following rout sum one and two let's hit the enter and we see three right here let's increase the numbers 1 2 3 slash 4 5 6 let's hit the

1:14:53 enter and we see five seven and nine that works correctly controller is a class which is associated to one or more roads and is responsible for handling requests of that roads generally controller is a grouping of similar roads together for example product controller should contain only logic Associated to products but not anything else car controller should not contain logic which is not associated to cars we can create controller classes manually or we can execute Artisan commments doing this with Artisan Commons is more convenient and fast so this is how we're going to

1:15:40 do also PHP artisan make controller and we're going to provide the name of the controller I'm going to call my controller car controller it is also convention that your controller classes should should end with controller suffix in our case it is car controller let's hit the enter the output tells us that the new file was created under up HTTP controllers F folder called car controller okay we are going to open this up HTTP controllers car controller this is how car controller looks like by default now let's create a road and associate action to that controller I'm

1:16:27 going to define a function called index okay from this function I'm going to return hardcoded text index method from car controller let's save this now I'm going to open roads file web.php and I'm

…

Share

More video summaries