File: D:/HostingSpaces/ZelfVerkopen/zelfverkopen.nl/app/KommaApp/LandingPages/Kms/LandingPageService.php
<?php
namespace App\KommaApp\LandingPages\Kms;
use App\KommaApp\Kms\Core\Tree\Tree;
use App\KommaApp\Kms\SidebarListItem;
use App\KommaApp\Pages\Kms\PageService;
class LandingPageService extends PageService
{
protected $sortable = false;
/**
* Returns all models for the sidebar menu in the backend
*
* @return array
*/
public function getModelsForSideBar():array
{
$models = $this->forModelName::where('code_name', '')
->get();
$models = $models->sortBy('translation.name');
$sidebarList = [];
foreach ($models as $model) {
$sidebarListItem = new SidebarListItem();
$this->setThumbnail($model);
$this->generateThumbnail($model);
//Set the values for the sidebar
$sidebarListItem->setId($model->id);
$sidebarListItem->setStatus($model->active);
$title = \App\Helpers\KommaHelpers::str_limit_full_word($model->title, 75);
$sidebarListItem->setName($title);
$sidebarListItem->setThumbnail($model->thumbnail);
$sidebarList[] = $sidebarListItem;
}
return $sidebarList;
}
}