for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'title', 'body', 'author_id',
];
public function author()
return $this->belongsTo(Author::class, 'author_id');
}
public function images()
return $this->hasMany(Image::class, 'post_id');