Introducing Laravel and Herd0:08
It is time. We talk about the first L in Tall Stack. Lateral Lateral is the most popular and the most productive PHP framework right now. Let's jump right in and we'll talk more about it as we explore it. Head over to later. well.com and click on Get Started. The easiest way to install later, well in 2025 is using Herd.
The easiest way to install later, well in 2025 is using Herd. Herd is a one click installer that comes with PHP Composer Nginx MySQL. Everything you need for lateral development, it's available for both Mac, OS and Windows. So you can quickly go to herd.lateral.com and download the version that's required for your os. I have a Mac and I have already downloaded and installed it. Once you install it, if you're on Mac,
I have a Mac and I have already downloaded and installed it. Once you install it, if you're on Mac, you will see the herd icon on top in your menu bar. Or if you have Windows, it'll be available at the bottom menu bar like so. Click on the herd icon view sites. Here. You can manage all your lateral projects. On the PHP tab. You can manage various versions of PHP. In the node tab. You can manage different versions of Node and here you have some general settings.
Creating a New Project1:21
In the node tab. You can manage different versions of Node and here you have some general settings. If you go to sites, you can add a new site and you can create one right here, but I'd like to do it in the terminal, so I will cancel it. Head over to your favorite command line tool and CD into Herd. This would've gotten created when you installed Herd. And here let's create a new lateral project using the command lateral, which is available with Heard
And here let's create a new lateral project using the command lateral, which is available with Heard New is the keyword. That's how you create a new Laravel app. And since we are gonna call our app Talent two, I'll call the Laravel project as Talent two. So hit enter. Now you are asked which starter kit would you like to install? Lateral comes with some start kits, but to understand it first let's click on none.
Lateral comes with some start kits, but to understand it first let's click on none. Let's start it plain and see what it has rest of the things. I will just select the default options testing framework as best, and now it starts creating a new lateral project. This might take a while, and now it's asking us which database will your application use. SQ Lite is the simplest. I will select it. It's running some migrations, which we will understand later
Running the App Locally2:32
SQ Lite is the simplest. I will select it. It's running some migrations, which we will understand later and installing some more packages. Once we are done, it's going to ask, would you like to run NPM install and NPM Run Build? Let's say Yes. And now the lateral app is ready. This is how we can get started. We can see the Intuit and say, composer run dev
We can see the Intuit and say, composer run dev to start the development environment. So let me CD into Tale two and say, composer Run Dev. Okay, looks like the server is running, so we should be able to see our app in the browser right now. So go back to the browser and now you can view your app under the subdomain test. So you can say Tale to test.
and now you can view your app under the subdomain test. So you can say Tale to test. This is the name of your application. And DOT test is How Herd helps you view your app in local Host. So this is the lateral 12 project that you've just installed. This is the homepage. Now let's go to the code and see what it looks like. You can go back to the terminal, open a new tab,
Exploring Project Structure3:37
Now let's go to the code and see what it looks like. You can go back to the terminal, open a new tab, and here CD into Heard slash taleo and use the command code space.to open this in Visual Studio code. So this is the code base of our newly created lateral application. If you've never worked with frameworks before, seeing these many folders and files might be a little overwhelming,
before, seeing these many folders and files might be a little overwhelming, but let's take it step by step. Now, the most important thing for any application is routes. That's where you define what happens when a user types in a particular URL on the browser. So for example, tale Toe test slash login, what is it that the app should do? We define that in routes here.
that the app should do? We define that in routes here. You can look at the routes folder, open it and you will find Web DO bhp, which consists of all the web routes. Currently we see a single get route that returns welcome view. Now before we go any further, it's better you install this official Visual Studio code extension for lateral. So just type in lateral and install this.
Understanding Blade Views4:48
official Visual Studio code extension for lateral. So just type in lateral and install this. It'll help you navigate the app and there are many such features. Close it. So now if you simply hold the option key and click on Welcome, it'll take you to welcome blade PHP. This is our view. As you can see, look at the file extension. It's blade PHP. What is blade? Blade is a templating engine used by PHP.
It's blade PHP. What is blade? Blade is a templating engine used by PHP. It just helps you write neat and readable code using PHP and HTML in the same file. So if you scroll down, you will see some directives, like if at wheat, at el, and if you scroll down further, there's something called at auth. All of these, if you write everything in plain PHP, it's gonna be hard to read.
All of these, if you write everything in plain PHP, it's gonna be hard to read. Also, blade has layouts and components that we will explore in the next few episodes. So all our views will be blade files and they will be located in this views folder. If you want to confirm that this is what you're seeing in the browser, just select everything, delete it, and
MVC and Environment Setup5:56
what you're seeing in the browser, just select everything, delete it, and to simply type something like Hello, go back to the browser. And here you can see. Hello. So that's what we were seeing for sure. Go back to the code and let me undo the changes and put back what was there. Now let's understand a little bit more about lateral. Lateral is an MVC framework where MVC stands for models, views, and controllers views is what you just saw.
Lateral is an MVC framework where MVC stands for models, views, and controllers views is what you just saw. Now this is how a user looks at your app. This is how they interact with IT. Models is what communicates to the database, inserts the data or gets it from there. The controllers is what is in between that communicates between the views and models. We don't have to talk a lot of theory. We will be creating models, views,
We don't have to talk a lot of theory. We will be creating models, views, and controllers in the next few episodes. For now, just know that your views are located inside resources and views. Your models will be within the app folder models and your controllers within app HGTP controllers. And one last thing you need to note right now is the dot NV file, which is at the root of your project.
to note right now is the dot NV file, which is at the root of your project. This is the setting sheets of your entire application. It contains the name, the environment, and if you scroll down, the database details, the mailer details, and all of the important data that you need. This file is important because you can change any of the username, password and things like that in one single place
because you can change any of the username, password and things like that in one single place and do not have to touch the code each time. The most important thing to note is that you should not share this MB file in public. This contains sensitive data, so it is not committed to gi. That's enough information for now. See you in the next one.
