<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

/**
 * Class PostEntity
 *
 * @property int $id
 * @property int $post_id
 * @property int $entity_id
 * @property Carbon|null $created_at
 * @property Carbon|null $updated_at
 * @property Post $post
 * @property Entity $entity
 */
class PostEntity extends Model
{
    protected $table = 'post_entities';

    protected $casts = [
        'post_id' => 'int',
        'entity_id' => 'int',
    ];

    protected $fillable = [
        'post_id',
        'entity_id',
    ];

    public function post()
    {
        return $this->belongsTo(Post::class);
    }

    public function entity()
    {
        return $this->belongsTo(Entity::class);
    }
}
