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