Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Book;
- class Author extends Model
- {
- protected $fillable = [
- 'name','email','nationality'];
- //One author to many book
- public function books()
- {
- return $this->hasMany(Book::class);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement