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/SBogers10/netwerkbrabant.komma.pro/app/KommaApp/Questions/Models/Question.php
<?php
/**
 *
 *
 * @author      Komma <info@komma.pro>
 * @copyright   (c) 2012-2016, Komma
 */

namespace App\KommaApp\Questions\Models;

use App\KommaApp\Documents\DocumentsTrait;
use App\KommaApp\Documents\Kms\DocumentableInterface;
use App\KommaApp\Kms\Core\AbstractTranslatableModel;
use App\KommaApp\Kms\Core\Entities\DisplayNameTrait;
use App\KommaApp\Kms\Core\NestedSets\Nodes\AbstractTranslatableTreeModel;
use App\KommaApp\Kms\Core\NestedSets\Nodes\TreeModelLogicTrait;
use App\KommaApp\Languages\Models\Language;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;

use Laravel\Scout\Searchable;

/**
 * Class Question
 *
 * @package App\KommaApp\Questions\Models
 * @property-read \App\KommaApp\Sites\Models\Site $site
 * @mixin \Eloquent
 * @property int $id
 * @property int $active
 * @property int|null $lft
 * @property int|null $rgt
 * @property int|null $tree
 * @method static \Illuminate\Database\Eloquent\Builder|\App\KommaApp\Questions\Models\Question whereActive($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\KommaApp\Questions\Models\Question whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\KommaApp\Questions\Models\Question whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\KommaApp\Questions\Models\Question whereUpdatedAt($value)
 */
class Question extends AbstractTranslatableTreeModel
{
    use DisplayNameTrait;

    protected $table = 'questions';
    protected $class = Question::class;

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

    /*
    * Transient properties on Eloquent models
    * These are not saved to database.
    */
    public $thumbnail = false;




    public function translations(): HasMany
    {
        return $this->hasMany(QuestionTranslation::class);
    }

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