Files
opentextsummaries/app/Models/Book.php
T

35 lines
591 B
PHP
Raw Normal View History

2025-09-13 17:39:17 +03:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Book extends Model
{
protected $fillable = [
'title',
'slug',
'author',
'cover_image',
'publication_date',
'description',
'category_id',
];
/**
* Get the category that owns the book.
*/
public function category()
{
return $this->belongsTo(Category::class);
}
/**
* Get the summary associated with the book.
*/
public function summary()
{
return $this->hasOne(Summary::class);
}
}