public function transform(Location $location)
    {
        return [
            'id' => $location->id,
            'name' => $location->name,
            'upcomingJobsCount' => (count($location->upcoming_jobs_count) > 0) ? $location->upcoming_jobs_count[0]->aggregate : 0,
        ];
    }
public function transform(Location $location)
    {
        return [
            'id' => $location->id,
            'name' => $location->name,
            'upcomingJobsCount' => (count($location->upcoming_jobs_count) > 0) ? $location->upcoming_jobs_count[0]->aggregate : 0,
        ];
    }
public function transform ( Location $ location ) { return [ 'id' => $ location -> id , 'name' => $ location -> name , 'upcomingJobsCount' => ( count ( $ location -> upcoming_jobs_count ) > 0 ) ? $ location -> upcoming_jobs_count [ 0 ] -> aggregate : 0 , ] ; }
Transformer to generate JSON response with Location data

@return array
Transformer to generate JSON response with Location data