mattbenton.io blog
TOPICS
April 14, 2022
Learn how to use the group by clause to combine query results into groups. This can be used to report useful statistics on the data in your database.
December 28, 2021
Joins is one of those programming concepts that took me a while to understand. I have without a doubt written plenty of inefficient code because I didn't know how to get data out of the database the way I needed it. As it turns out, joins are not a very complicated concept. They are a little harder to understand than bas...
October 14, 2021
Inertia.js is described as the "glue" between your frontend and backend framework. After I learned about how it could help me write a SPA with Laravel and Vue while avoiding a lot of the SPA complexity, I decided to convert one of my apps to Inertia.
August 21, 2021
Learn how to use accessors to create computed database fields, which are not stored in the database but instead calculated when records are retrieved from the database.
June 23, 2021
This is a guide for installing Vue 3 into an existing project using Laravel Mix. Note that this does not have to be a Laravel project, as Mix can compile your frontend assets for any web project. This guide may be helpful for you if you want use Vue 3 but do not have the opportunity to scaffold out a new project.
April 19, 2021
It is very common for data to be related to other data in the database. Eloquent is helpful here because it sits on top of our database and helps us easily manage these relationships. This saves us from having to do unnecessary work. And when your database starts getting complicated, having these tasks taken care of for you...
February 26, 2021
For a long time I have defaulted to using const to declare variables, but now that I know more about the const keyword I am starting to think this is not such a good idea.
December 29, 2020
Lately I have been spending a lot of time on a website that I love, Execute Program. This is a site that helps you learn and practice programming (mostly JavaScript) in a way that I have not seen any other "learn to code" site attempt. I find the approach to be very unique and refreshing, and I hope to see more of it by web...
November 10, 2020
Pure functions are typically simple functions that take in some input, process it, and return a result as output. More importantly, if the input is the same, the output of a pure function will always be the same. These functions are small building blocks for our application and we rely on them as we structure larger, more c...
October 7, 2020
JavaScript arrays have tons of functions that allow you to manipulate them. You can flatten them, map them, push, pop, and sort them. To be honest, I still don't know exactly what some of these methods do. Recently I learned about reduce(), which is a method that has taken me a long time to understand. It's not that it's v...
September 16, 2020
If statements are programming 101. We don't get very far without them. They help us check the state of our software and then do something based on the result. I am going to offer some tips to improve complicated "if" statements to make them easier to read. These tips will help you write cleaner, more readable "if" statement...
August 20, 2020
It is widely-accepted knowledge the good developers have to have good problem solving skills. Let's face it - programming is difficult and even the best of us run into problems fairly often. When you're a programmer, you will be faced with a challenge and it will be up to you to solve it. It's important to understand goo...
August 19, 2020
Web browsers cache files downloaded for websites to optimize performance. This is great for using the web but it means updated files may be blocked from reaching users. We can use Laravel Mix to easily bust the cache and force the browser to download the most current versions of our assets.
August 14, 2020
The CSS box model determines how HTML elements are laid out on a page. Any displayable element you can think of adheres to the box model. For this reason the box model is a fundamental part of CSS. Understanding it will help you place HTML elements more precisely. It will also make debugging a lot easier.