Files
futurewalker/app/Models/PostEntity.php
2023-11-20 00:32:26 +08:00

47 lines
778 B
PHP

<?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);
}
}