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/pietvanmierlo/stempelbv.nl/app/Komma/References/ReferenceService.php
<?php


namespace App\Komma\References;


use App\Komma\Base\Service;
use Carbon\Carbon;

final class ReferenceService 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 getAllReferences($pagination = false, $itemsPerPage = 9)
    {
        $references = $this->site
            ->references()
            ->with('translation')
            ->where('active', 1)
            ->orderBy('created_at', 'desc')
            ->whereHas('translation');

        if($pagination)
        {
            $references = $references->paginate($itemsPerPage);
        }
        else
        {
            $references = $references->get();
        }
        return $references;
    }


}