Test event inside an Eloquent observer

Most times you test that events are fired by adding Event::fake() to your tests. This will make Event::assertDispatched(SomeEvent::class) to return true. However, no events will trigger as soon...

Mock Laravel Cache remember for ever

Sometimes you want to make sure certain things are cached properly. With mocking this is possible. In this example I will show how to test Cache::rememberForever and see the...

Cannot add foreign key constraint

The most common error I see when trying to create foreign key constraints is you forget that the colmuns must have the same type, including unsigned() if unsigned. In...

Fix HTTP2 in cURL and Laravel Valet

While working with Apple’s new API for push notifications and Laravel, I had to make requests to Apple’s servers via http2 from my local Laravel Valet instance. Lately, the brew...

Fix Guzzle Curl Error 60 SSL unable to get local issuer

While working with Apple’s new API for push notifications and Laravel, I had to make requests to Apple’s servers via http2 a Ubuntu 20.04 server. I did check...