File: D:/HostingSpaces/SBogers10/conmeq.komma.pro/app/Komma/Employees/EmployeeService.php
<?php
namespace App\Komma\Employees;
use App\Komma\Base\Service;
use Carbon\Carbon;
class EmployeeService extends Service
{
private $today;
public function __construct()
{
$this->today = Carbon::now()->addHour();
$this->today = $this->today->format('Y-m-d H:i:s');
parent::__construct();
}
public function getAllEmployees($pagination = false, $itemsPerPage = 9)
{
$employees = $this->site
->employees()
->with('translation', 'images')
->where('active', 1)
->orderBy('lft')
->whereHas('translation');
if($pagination)
{
$employees = $employees->paginate($itemsPerPage);
}
else
{
$employees = $employees->get();
}
return $employees;
}
}