File: D:/HostingSpaces/brameda/brameda.nl/app/Komma/Services/ServiceService.php
<?php
namespace App\Komma\Services;
use App\Komma\Base\Service;
use Carbon\Carbon;
class ServiceService 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 getAllServices($pagination = false, $itemsPerPage = 9)
{
$services = $this->site
->services()
->with('translation', 'images')
->where('active', 1)
->orderBy('lft')
->whereHas('translation');
if($pagination)
{
$services = $services->paginate($itemsPerPage);
}
else
{
$services = $services->get();
}
return $services;
}
}