How to test protected functions with PHPUnit in your Laravel app

An essential part of developing an app is testing your code. My preferred method of testing my Laravel code is using PHPUnit and this is how I use reflection to test those 'harder to reach' protected and private methods inside classes....

May 13, 2023 · 5 min · Sam Anglin

Undefined type 'Spatie\Permission\Models\' . 'Permission' | 'Role' | 'HasRoles'

VSCode with intelephense throws a strange and hard to debug error when using the spatie/laravel-permissions package even when you follow the docs to the letter. Here is how to fix it....

April 13, 2023 · 2 min · Sam Anglin

How to Unlock Formkit Multistep forms on a Laravel Inertia app with Vue 3

Formkit offers a great Multi-Step tool for building forms in your Vue app, but getting it to work inside a Laravel Inertia app is a little tricky. Here is how to get it running....

March 9, 2023 · 4 min · Sam Anglin

Developing a Laravel Application using Tinker

The Laravel framework has a huge amount of helpful features, let's take a deeper look at one of the most powerful. Tinker....

February 8, 2023 · 8 min · Sam Anglin

If it doesn't make sense, build a little version

Been a while since I wrote a longer article, so here's a longer article explaining what it is I have been doing. Basically levelling up a bit. Learning to build and building to learn!...

May 15, 2022 · 5 min · Sam Anglin