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/CustomerLogos/Models/CustomerLogo.php
<?php
/**
 * @author      Komma <info@komma.pro>
 * @copyright   (c) 2012-2016, Komma
 */

namespace App\Komma\CustomerLogos\Models;

use App\Komma\Countries\Models\Country;
use App\Komma\Documents\DocumentsTrait;
use App\Komma\Documents\Kms\DocumentableInterface;
use App\Komma\Kms\Core\Entities\DisplayNameInterface;
use App\Komma\Kms\Core\Entities\DisplayNameTrait;
use App\Komma\Kms\Core\NestedSets\Nodes\AbstractTranslatableTreeModel;
use App\Komma\Languages\Models\Language;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;

/**
 * Class Page
 *
 * @property int site_id
 * @property int lft
 * @property int rgt
 * @property int tree
 * @property-read \Carbon $date
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Languages\Models\Language[] $languages
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Sites\Models\Site[] $sites
 * @property-read \App\Komma\CustomerLogos\Models\CustomerLogoTranslation $translation
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\CustomerLogos\Models\CustomerLogoTranslation[] $translations
 * @mixin \Eloquent
 * @property int $id
 * @property int $active
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\CustomerLogos\Models\CustomerLogo whereActive($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\CustomerLogos\Models\CustomerLogo whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\CustomerLogos\Models\CustomerLogo whereDate($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\CustomerLogos\Models\CustomerLogo whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\CustomerLogos\Models\CustomerLogo whereUpdatedAt($value)
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Documents\Models\Document[] $documents
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Documents\Models\Document[] $images
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\CustomerLogos\Models\CustomerLogo newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\CustomerLogos\Models\CustomerLogo newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\CustomerLogos\Models\CustomerLogo query()
 */
class CustomerLogo extends AbstractTranslatableTreeModel implements DocumentableInterface, DisplayNameInterface
{
    use DocumentsTrait;
    use DisplayNameTrait;

    protected $table = 'customer_logos';

    protected $class = self::class;

    protected $fillable = ['site_id', 'name', 'url', 'lft', 'rgt', 'tree'];

    /**
     * Gets the translation models for this model
     *
     * @return HasMany that resolves to AbstractTranslationModel instances
     */
    public function translations(): HasMany
    {
        return $this->hasMany(CustomerLogoTranslation::class);
    }

    public function languages(): BelongsToMany
    {
        return $this->belongsToMany(Language::class, 'customer_logo_translations')
            ->withPivot('slug', 'name', 'description')
            ->withTimestamps();
    }

    public function countries(): BelongsToMany
    {
        return $this->belongsToMany(Country::class, 'customer_logo_countries');
    }
}