TIP 85 / 100

Make Use of the Value Method on the Query Builder.

Make use of the value method on the query builder to execute a more efficient query when you only need to retrieve a single column.

code
// Before (fetches all columns on the row)
Statistic::where('user_id', 4)->first()->post_count;

// After (fetches only `post_count`)
Statistic::where('user_id', 4)->value('post_count');