23 lines
368 B
PHP
23 lines
368 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Author extends Model
|
|
{
|
|
protected $fillable = [
|
|
'name',
|
|
'slug',
|
|
'bio',
|
|
];
|
|
|
|
/**
|
|
* The books that belong to the author.
|
|
*/
|
|
public function books()
|
|
{
|
|
return $this->belongsToMany(Book::class, 'author_book')->withTimestamps();
|
|
}
|
|
}
|