Articles

hasOne and belongsTo confuse me!

9 months ago

This title comes from a Reddit post I saw the other day. The poster argues that the hasOne() and belongsTo() model methods are "counter-intuitive". My...

Read more

Is your site slow? Check your database queries

9 months ago

Is your website slow? does it take ages to load? Are the users complaining that it's almost unusable?. You should check your database queries. And I'm...

Read more

You should never use env() outside of your config files

9 months ago

I've seen a couple of questions on laravel forums that look something like this. .env Not Reading Variables Sometimes env() / getenv() Sometimes No...

Read more

Real world example of the power of collections

9 months ago

You've probably seen a lot of tweets and blog posts about how collections can make your code more readable and compact, reducing if statements and ugl...

Read more

Writing tests for functions that store files

9 months ago

You might have a function that generates a pdf, stores an attachment, or uploads an image. But have do you test that the file is getting created witho...

Read more