bookinventory/app/Models/Book.php

26 lines
441 B
PHP
Raw Normal View History

2020-12-21 07:09:34 +00:00
<?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
class Book extends Authenticatable {
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
];
public function author() {
return $this->hasMany(Author::class);
}
public function location() {
return $this->belongsTo(Location::class);
}
}