How To Set Up Form Submission In Laravel

How To Set Up Form Submission In Laravel

In our little games app, we don’t yet have a way to add new games to the database using the app itself. We are only able to insert new data by using the MySql console directly, or via phpMyAdmin. Let’s change that up and start looking at how we can add the ability to render a form so that we can submit new games. We’ll need a new route and controller method to display the form, as well as a new route and controller method to store the data into the database.…

Creating A Layouts Template In Laravel

Creating A Layouts Template In Laravel

It’s time to make things look a little more pretty than we have so far. So far, we have been simply outputting data to the web browser with no formatting or special CSS applied in any way. In fact, this is a good way to begin things, as it has allowed us to stay completely focused on the core concepts of Laravel. Soon however, your web designer side wants to contribute to the game to get things looking better.…

Route Model Binding In Laravel

Route Model Binding

What is Route Model Binding? I’m glad you asked! That is exactly what we’ll take a look at in this post. So far we’ve been experimenting with various features of the Laravel framework as we build out a simple application that allows us to keep track of games in a database. We’ve created two routes so far, and one of them accepts an id so that we can fetch a specific game from our database.…

Moving From Routes to Controllers in Laravel

Moving From Routes to Controllers in Laravel

If you wanted to, you could build a pretty substantial application and never make use of a controller. How could this be? Well, we saw in our introduction to basic routing and views that we can pass a closure to the second argument of a Route::get() request. The drawback is that pretty soon, you are going to have a routes file the size of Manhattan, and that is probably not ideal.…

How To Get Started With Eloquent In Laravel

How To Get Started With Eloquent In Laravel

Eloquent makes use of the Active Record pattern adored by software developers far and wide. Active Record was originally named by the software developer Martin Fowler when he discussed it in his book titled Patterns of Enterprise Application Architecture. It is a pattern where an Object maps to a table in a database. The object’s properties usually correspond to the columns in the given table. It’s a convenient and easy to use pattern, and Eloquent is a great version of active record.…