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/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;
    }

}