/** * Implement getAll() */ public function getAll($limit = 10) { // using the Eloquent model if ($limit == 0) { return Location::get(); } elseif ($limit == 1) { return Location::first(); } return Location::limit($limit)->get(); }