i always use this ugly code to get a single value from the database for a given id
for example here i want to get the number of visits for a website
// ============================================ getNumberOfVisits()
//
// website_name : ..
// return the number of visits for a given website
//
private function getNumberOfVisits($website_name)
{
$visits = Website::where('name', $website_name)->get(['number_of_visit']);
return $visits[0]['attributes']['number_of_visit'];
}
is there another way to get a single value from the database for a particular column given a where statement?