bookinventory/app/Models/Author.php

22 lines
330 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Author extends Model {
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
];
public function books() {
return $this->belongsToMany(Book::class);
}
}