I know its old, but still - The query builder have a handy method called value
. This is actually what you are looking for.
// The value of column_1 of the first matched result where column_2 is 'somthing'$my_value = DB::table("my_table") ->where("column_2", "=", "something") ->value("column_1")
And it also works with models
$my_value = MyModel::where("column_2", "=", "something")->value("column_1")