first commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user