<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * @property integer $id
 * @property integer $pid
 * @property int $status_id
 * @property integer $created_by
 * @property integer $updated_by
 * @property string $title_ba
 * @property string $title_en
 * @property string $description_ba
 * @property string $description_en
 * @property string $content_ba
 * @property string $content_en
 * @property string $slug
 * @property string $link
 * @property string $image
 * @property string $widget_content_ba
 * @property string $widget_content_en
 * @property string $created_at
 * @property string $updated_at
 * @property User $user
 * @property MenuPage $menuPage
 * @property Status $status
 * @property User $user
 */
class MenuPage extends Model
{
    /**
     * The "type" of the auto-incrementing ID.
     *
     * @var string
     */
    protected $keyType = 'integer';

    /**
     * @var array
     */
    protected $fillable = ['pid', 'status_id', 'created_by', 'updated_by', 'title_ba', 'title_en', 'description_ba', 'description_en', 'content_ba', 'content_en', 'slug', 'link', 'image', 'widget_content_ba', 'widget_content_en', 'created_at', 'updated_at'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo('App\User', 'created_by');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function menuPage()
    {
        return $this->belongsTo('App\MenuPage', 'pid');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function status()
    {
        return $this->belongsTo('App\Status');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function updatedBy()
    {
        return $this->belongsTo('App\User', 'updated_by');
    }
}
