Laravel gives a lot of syntactical sugar helpers. This allows you to write your Laravel code in a few different flavors or dialects. Some programmers prefer using fluent interfaces, others composition, and others pure functional statements.
As a seasoned and salty programmer, I tend to stick with what I know. It can be easy to overlook the helpers that Laravel provides. But, with Eloquent, the when function is way more useful than a simple helper. The true eloquence comes from its handling of the results of the first condition check.
Sometimes I need to spin up a quick Laravel instance on my Mac to test something out. With just a couple keystrokes, I can get a brand new Laravel instance running in a Docker container, ready for my IDE and testing. Here’s how.
What type of contractor are you hiring? That’s a question you should be asking yourself - and them - before you pull the trigger. Let me expand on the reason for this…
Thanks to the foexplorer website, we have the manuals for 2020-2024 Ford Explorers online. After working with my mechanic brother on mine, it became clear that we need printable versions of these for some people. So I created a system to make them printable.
In part 1, I introduced the problem of periodically retrieving a JSON data end point and appending it to a file. This small, quick task can easily
be solved by the demonstrated Laravel code. It’s simple, concise and readable. But is it the best solution?
“If you only have a hammer, everything is viewed as a nail” is an idiom referred to as Maslow’s hammer. It basically means that if you only know one tool, and you over-rely on it,
you’ll only use that tool to solve every problem, regardless of whether it’s the right one for the job. (It’s a common saying around these parts… that and Joel’s famous saying
“Do you even have a 5th bathroom if the floor isn’t heated?”)
Laravel is quite the Swiss Army Knife - it has easy solutions for just about every problem and task you have. That’s why I’m such a fan of it. But is it always the right tool for the job?
Showing and hiding AlpineJS elements on click or other actions are pretty easy. But what if you just wanted to show the element after a little bit of a delay with no user interaction? We can do that easily!
There’s a common design pattern on a lot of websites to alter the header when the user scrolls down. A lot of times this is simply some sort of handler that adds a class (or removes it). (There are other complex, arguably ‘better’ solutions with IntersectionObserver - but that’s not the point of this article.) Let’s take a look at a very simple version of a script that watches for scroll and adds/removes a class on the body. Then, let’s make it better - and learn while we do it.
I love writing in Markdown - and offering that functionality in WYSIWYG editors for our users. But, it just seems so complicated to try to show markdown in Laravel blade files. So, I made a quick anonymous component that makes this easier.