File: D:/HostingSpaces/SBogers10/werkenbij.komma.pro/app/Komma/Servicepoints/ServicepointService.php
<?php
namespace App\Komma\Servicepoints;
use App\Komma\Base\Service;
use Carbon\Carbon;
final class ServicepointService 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 getAllServicepoints($pagination = false, $itemsPerPage = 9)
{
$servicepoints = $this->site
->servicepoints()
->with('translation')
->where('active', 1)
->orderBy('created_at', 'desc');
if($pagination)
{
$servicepoints = $servicepoints->paginate($itemsPerPage);
}
else
{
$servicepoints = $servicepoints->get();
}
return $servicepoints;
}
}