simedkom/app/Models/ContentRecapClassification.php
myuqinurrohman 0994e1717a chore: change show content recap UI
chore: change show content recap classification UI

feat: add grouping by classification
2025-04-17 14:43:27 +07:00

29 lines
603 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class ContentRecapClassification extends Model
{
use SoftDeletes;
protected $table = 'content_recap_classifications';
protected $fillable = [
'name',
'slug',
'year',
'description',
'enhancer_id'
];
public function contentRecaps(){
return $this->hasMany(ContentRecap::class, 'classification_id', 'id');
}
public function enhancer(){
return $this->belongsTo(User::class, 'enhancer_id', 'id');
}
}