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