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/SBogers95/rentman.io/app/Komma/SiteConfig/Models/SiteConfig.php
<?php
/**
 * @author      Komma <info@komma.pro>
 * @copyright   (c) 2012-2016, Komma
 */

namespace App\Komma\SiteConfig\Models;

use App\Komma\Documents\DocumentsTrait;
use App\Komma\Documents\Kms\DocumentableInterface;
use App\Komma\Kms\Core\Attributes\Models\Traits\HasThumbnailInterface;
use App\Komma\Kms\Core\Attributes\Models\Traits\HasThumbnailTrait;
use App\Komma\Kms\Core\Entities\DisplayNameInterface;
use Illuminate\Database\Eloquent\Model;

class SiteConfig extends Model implements DisplayNameInterface, HasThumbnailInterface, DocumentableInterface
{
    use DocumentsTrait;
    use HasThumbnailTrait;

    protected $table = 'site_config';

    protected $class = self::class;

    protected $fillable = ['key', 'value'];

    /**
     * Get the name of this model by model or translation model
     *
     * @return null|string
     */
    public function getDisplayName():?string
    {
        // First try to get the name of the model
        if (isset($this->sidebar_name) && $this->sidebar_name != '') {
            return $this->sidebar_name;
        }

        return null;
    }

    /**
     * @return string
     */
    public function getSidebarName():string
    {
        return $this->getDisplayName();
    }
}