File: D:/HostingSpaces/SBogers10/rentman2019.komma.pro/app/Komma/WebinarTags/Models/WebinarTag.php
<?php
/**
* @author Komma <info@komma.pro>
* @copyright (c) 2012-2016, Komma
*/
namespace App\Komma\WebinarTags\Models;
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 App\Komma\Webinars\Models\Webinar;
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\WebinarTags\Models\WebinarTagTranslation $translation
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\WebinarTags\Models\WebinarTagTranslation[] $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\WebinarTags\Models\WebinarTag whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\WebinarTags\Models\WebinarTag whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\WebinarTags\Models\WebinarTag whereDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\WebinarTags\Models\WebinarTag whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\WebinarTags\Models\WebinarTag 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\WebinarTags\Models\WebinarTag newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\WebinarTags\Models\WebinarTag newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\WebinarTags\Models\WebinarTag query()
*/
class WebinarTag extends AbstractTranslatableTreeModel implements DocumentableInterface, DisplayNameInterface
{
use DocumentsTrait;
use DisplayNameTrait;
protected $table = 'webinar_tags';
protected $class = self::class;
protected $fillable = ['site_id', 'lft', 'rgt', 'tree'];
/**
* Gets the translation models for this model
*
* @return HasMany that resolves to AbstractTranslationModel instances
*/
public function translations(): HasMany
{
return $this->hasMany(WebinarTagTranslation::class);
}
public function languages(): BelongsToMany
{
return $this->belongsToMany(Language::class, 'webinar_tag_translations')
->withPivot('slug', 'name', 'description')
->withTimestamps();
}
public function webinars(): BelongsToMany
{
return $this->belongsToMany(Webinar::class, 'webinar_tag_webinars');
}
}