Another new release from me this week: the first part of the course about testing in Laravel, see a free intro video below. I'm starting the work on the second part, while still continuing daily Youtube videos and this newsletter. Enjoy!
From my Youtube Channel
Tweets of the week
From Laravel Community
How to Mock Objects in PHPUnit / PEST tests in Laravel
I always dreaded learning about Mocking in testing assuming it would be something too complex, and I never really had the requirement of using Mocking in my Laravel tests. But now since I have a basic idea about Mocking objects, here is a simplified version of the concept in my understanding.
What is takes to do CI/CD for Laravel
There's a lot that goes into running CI/CD for a Laravel application! Let's dig into the factors that go into successfully building, testing, and deploying Laravel. This will be about Chipper CI (duh), but the things we discuss here apply to CI/CD no matter where you do that.
Catching Up Laravel
If you're running a Laravel application in the 5's, have a legacy application bootstrapped inside Laravel, don't have any tests, or are staring in silent terror at just how long ago your production server's PHP version hit its end-of-life, this post is for you!
Setup GitHub Actions for Laravel
In my previous blog, I talked about how to get started with browser tests in Laravel. You will want to run those tests (and, unit/feature tests as well) on every code push, thus making sure that your code changes are working as expected, and doesn't break anything.
Why don't you start writing tests?
There are hundreds of articles on why you should write tests for your code. And I assume you have read them many times. Many developers realize the importance of writing tests but just do not get started.
Rich Text Laravel Attachments With Media Library
In a previous introduction to the Rich Text Laravel package I hinted that I wanted to cover how to build a more advanced attachment handling using Spatie's Media Library package. This is the follow-up on that. We'll pick it up from where the previous article ended to keep this one short.
Style PHP The Laravel Way with Laravel Pint
Keeping your application’s code styled consistently is important, especially when the project has multiple developers. It makes the code easier to read, which you’ll be thankful for, either when doing a code review, or having to go back and update your own code later.
Search and Replace in Laravel
Imagine you had to make a change in your database records. You have been assigned the task of updating the affected records. There is only one problem: you do not know which tables or how many records are affected. What do you do? That was an actual scenario that occurred sometime this week.
That's it for this week, see you in the next newsletter issue!