File: D:/HostingSpaces/SBogers10/stafa.komma.pro/app/Komma/Locations/LocationService.php
<?php
namespace App\Komma\Locations;
use App\Komma\Departments\DepartmentService;
use App\Komma\Departments\Models\Department;
use App\Komma\Locations\Models\Location;
class Locationservice
{
/**
* Base query for get locations from DB
*
* @return Location|\Illuminate\Database\Eloquent\Builder
*/
private function baseLocationQuery()
{
return Location::with('translation', 'images')
->where('active', 1);
}
/**
* Get collection of all locations
*
* @return \Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection
*/
public function getAllLocations() {
$locations = $this->baseLocationQuery()->orderBy('lft');
return $locations->get();
}
}