Before we dig into the nuts and bolts of Laravel, let's first zoom out and discuss what exactly happens when a request comes in.
Now that we have Composer setup, we can pull in the Laravel installer and make it accessible globally on our machine. This allows you to run a single command to build a fresh Laravel installation:
laravel new app.
When I learn a new framework, the first thing I do is figure out how the framework's default splash page is loaded. Let's work through it together. Our first stop is
request() helper function can be used to fetch data from any
POST request. In this episode, we'll learn how to fetch data from the query-string, pass it to a view, and then encode it to protected against potential XSS attacks.
Often, you'll need to construct a route that accepts a wildcard value. For example, when viewing a specific post, part of the URI will need to be unique. In these cases, we can reach for a route wildcard.
It's neat that we can provide a closure to handle any route's logic, however, you might find that for more sizable projects, you'll almost always reach for a dedicated controller instead. Let's learn how in this lesson.
*Series still in development. Check back often for updates.