April 3, 2021

What N+1 problem actually is?

I was reading a post on Laravel news which includes a number of tips to improve your database queries. It has tons of stuff that everyone should be aware of. Tip#5 specifies that you should be aware...

Read

February 24, 2021

Convert datetime string to carbon instance with laravel eloquent

Recently I was working on a project, where after querying the database via eloquent I get back a datetime string. I wanted to convert it in to timestamp. To my surprise, converting default...

Read

February 24, 2021

PHP is not dead

Today, I was listening to Jeffrey's podcast. He was talking about React, who wants to sit at cool kids table. There is a lot of fuss about React. Newbie like me would think, oh yes it is used by so...

Read

February 11, 2021

Laravel 8 - Retrieve one or two columns from Model

Often times when you are retrieving data from eloquent model, you just need some columns and not all of them. When using Laravel eloquent model to query database, Laravel will return a collection...

Read