File: D:/HostingSpaces/SBogers10/switch4u.komma.nl/app/Faq/FaqService.php
<?php
namespace App\Faq;
use App\Base\Service;
use App\Faq\Models\Faq;
use Carbon\Carbon;
class FaqService 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 getAllFaq($pagination = false, $itemsPerPage = 9)
{
$faq = Faq::with('translation', 'images')
->where('active', 1)
->orderBy('lft')
->whereHas('translation');
if($pagination)
{
$faq = $faq->paginate($itemsPerPage);
}
else
{
$faq = $faq->get();
}
return $faq;
}
}