Files
aibuddytool/app/Models/PostCategory.php
Charles T ded1643e5f Add (post manage)
Add (post country viewing)
2023-07-28 02:29:11 +08:00

47 lines
798 B
PHP

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class PostCategory
*
* @property int $id
* @property int $post_id
* @property int $category_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Category $category
* @property Post $post
*/
class PostCategory extends Model
{
protected $table = 'post_categories';
protected $casts = [
'post_id' => 'int',
'category_id' => 'int',
];
protected $fillable = [
'post_id',
'category_id',
];
public function category()
{
return $this->belongsTo(Category::class);
}
public function post()
{
return $this->belongsTo(Post::class);
}
}