1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use App\Models\Author; class Book extends Model { use HasFactory; public function author() { return $this->belongsTo(Author::class); } }