How to Directly Retrieve a Column Value in Laravel?
In this tutorial, we will see how to directly retrieve a column value in Laravel, we can use the eloquent method value() to do that.
Use the eloquent method value()
Let's assume that we want to retrieve the name of a given user using the provided email.
User::whereEmail('test@email.com')->value('name');