As my current project grew, so did my models. In a hunt for thinner models, I realised it was possible to extract model scopes to a dedicated query builder class. I'll show you how to do this, and a few things to keep in mind if you implement this refactor.
Monitoring your web application's performance is key to ensuring you provide a good experience for your users. Here is a tip to help you see where your app is slow on a Laravel Forge deployed server.
There are certain scenarios where PHP does not check or error if a class you reference does not exist. These are their stories. *dun-dun*
Having a fast test suite can be just as important as having a fast application. Here are some ways to make your test suite run faster.
In applications it is often useful to have a way to store some global settings. This post outlines my approach using a Spatie package to manage the values instead of Eloquent.
Laravel collections have become an essential part of my codebases and I couldn't imagine working without them. I have found giving collections the voice of the problem domain makes for a much nicer API when compared to the generic collection methods.
I do love a good feature test suite. I especially like them to be fast and, most importantly, trustworthy! As my approach has matured, and become stable, I thought I'd share how I go about setting things up.
Laravel's global mix helper function can be replaced during testing in Laravel 5.8. Here is why, and how, you might want to do this.
There are several ways to load relationship counts on eloquent models. I'm going to explore the options and introduce you to a new one.
I've found that introducing dedicated response objects that can handle multiple response formats is a really nice pattern to cleanup my controllers
If you are creating a Laravel app with subscriptions via Stripe - Laravel Cashier might just be the helping hand you were looking for.
Using Spatie's Laravel Backup package you can backup several sites on a server from a single app install, including Laravel apps and WordPress sites.
I've recently been getting more and more requests to get paper forms converted into digital versions, so I thought I'd put together this post to explain some of the advantages and possibilities digital forms open up.
A foreign key validation rule for the Laravel Validator that helps wrap up the 'exists' rule with a bit of syntactic sugar. Probably not fantastic to work with in the traditional fashion, but using the rule builder package...it looks gooooood!
A little trick I have been implementing recently to ensure that data accessed from a Laravel request object has first been validated.
Having never written a shell script before, I thought I'd try and level up my dev skills by writing a simple deployment script for my website and my clients websites. The outcome: FlipIt™
Laravel validation rules are great, but wouldn't it be awesome if there was a fluent interface for all the rules.
If you're in the Riverina and wanna meet up to discuss all things software - join our local developer Meetup.