The Visitor Pattern in PHP
– doeken.org - submitted by Doeke Norg – Edit
The Visitor Pattern opens up your entities to extension without changing them (much); and keeps the code separate.
Read more [doeken.org]
– doeken.org - submitted by Doeke Norg – Edit
The Visitor Pattern opens up your entities to extension without changing them (much); and keeps the code separate.
Read more [doeken.org]
by Freek Van der Herten – 1 minute read – Edit
In your tests, you might have used assertDatabaseHas to make sure that a model actual is persisted.
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"If you are one of the *millions* who have downloaded a Spatie package, then you understand the quality that Freek aims for. The newsletter is of the same quality of any Spatie package you're using."
– blog.frankdejonge.nl - submitted by Robin Dirksen – Edit
Bugs caused by race conditions can be a huge source or frustration. They are difficult to identify and often difficult to remedy.
Read more [blog.frankdejonge.nl]
– 42coders.com – Edit
Here are a few best practices for working with a large tables.
Read more [42coders.com]
by Freek Van der Herten – 11 minute read – Edit
My current setup (end 2021 edition)
After tweeting out a screenshot, it often get questions around which editor, font or color scheme I'm using. Instead of replying to those questions individually I've decided to just write down the settings and apps that I'm using.
– www.csrhymes.com – Edit
Here's how to use our spatie/simple-excel package to reate multi-worksheet files.
Read more [www.csrhymes.com]
by Ruben Van Assche – 12 minute read – Edit
In the vast majority of applications you work with data structures. Sometimes that data is described multiple times. Think for instance of a form request that tries to validate a blog post model, and an API transformer class for that same blog post model. Changes are that both classes describe the same properties.
Using our new laravel-data package, those structures only need to be described once.
by Brent Roose – 2 minute read – Edit
Have you ever had to write an API integration from scratch? Where you're managing the HTTP calls yourself instead of being able to rely on third-party packages?
- submitted by Mateus Guimarães – Edit
Mateus Guimaraes show a couple of neat tests powered by Pest.
by Brent Roose – 3 minute read – Edit
Mocking, faking; these might sound like intimidating words if you don't know what they are about, but once you do, you'll be able to improve your testing skills significantly.
Part of "the art of testing" is being able to test code in some level of isolation to make sure a test suite is trustworthy and versatile. These topics are so important that we actually made five or six videos on them in our Testing Laravel course.
In this post, I want to share three ways how you can deal with mocking and faking. Let's dive in!
by Brent Roose – 1 minute read – Edit
One of the things I really like about modern Laravel projects, are the new model factories introduced in Laravel 8.
by Freek Van der Herten – 2 minute read – Edit
A few days ago, a new version of 1Password was released that is able to detect where a user can reset his or her password.
– doeken.org - submitted by Doeke Norg – Edit
In this post I want to introduce you to Tree structures. What they are, how you can use them, and in which situation they can be helpful.
Read more [doeken.org]
by Brent Roose – 1 minute read – Edit
Testing a Laravel project is one of the most pleasant experiences I've ever had: there's a clean testing API, a very powerful layer added on top of testing frameworks; all while keeping the simplicity and eloquence you'd expect from a Laravel project.
– calebporzio.com – Edit
The experience of using Livewire seems magical. It's as if your front-end HTML can call your PHP code and everything just works. A lot goes into making this magic happen.
Read more [calebporzio.com]
– doeken.org - submitted by Doeke Norg – Edit
The Adapter pattern and the Bridge Pattern have brought along a lot of confusion. Time to connect the dots.
Read more [doeken.org]
by Freek Van der Herten – 1 minute read – Edit
This edition of the meetup features those two excellent talks:
– doeken.org - submitted by Doeke Norg – Edit
Enhance (final) classes and functions by implementing these similar, but not quite the same, patterns.
Read more [doeken.org]
– ryangjchandler.co.uk - submitted by Ryan Chandler – Edit
Let's look at how we can use Pest's Expectation API with array items.
Want to learn more about testing and/or Pest? Check out Testing Laravel
Read more [ryangjchandler.co.uk]
by Freek Van der Herten – 2 minute read – Edit
While recording videos for the Testing Laravel video course, I became a big fan of Pest, a test runner that tries to optimize the developer experience. I'm now using Pest as the default for testing new packages and projects.
I've also converted a couple of existing testsuites from PHPUnit to Pest. Luckily, this is a very easy process. In this video I'll show you how to get started. You'll see that it only takes a couple of minutes.