Files
saas/apps/backend/app/Models/Material.php
AHMET YILMAZ 6e7a8c784b
Some checks failed
CI Pipeline / Lint & Test Frontend (push) Has been cancelled
CI Pipeline / Test Backend (push) Has been cancelled
first intial
2025-09-16 22:59:46 +08:00

44 lines
781 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Material extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'category_id',
'title',
'author',
'description',
'cover_image_path',
'file_path',
'tags',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'tags' => 'array',
];
/**
* Get the category that owns the material.
*/
public function category()
{
return $this->belongsTo(Category::class);
}
}