HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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();
    }

}