Add (article): ai gen, front views
This commit is contained in:
46
app/Models/PostCategory.php
Normal file
46
app/Models/PostCategory.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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 Post $post
|
||||
* @property Category $category
|
||||
*/
|
||||
class PostCategory extends Model
|
||||
{
|
||||
protected $table = 'post_categories';
|
||||
|
||||
protected $casts = [
|
||||
'post_id' => 'int',
|
||||
'category_id' => 'int',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'post_id',
|
||||
'category_id',
|
||||
];
|
||||
|
||||
public function post()
|
||||
{
|
||||
return $this->belongsTo(Post::class);
|
||||
}
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(Category::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user