*/ protected $fillable = [ 'journal_id', 'file_cover_image_id', 'name', 'description', ]; /** * Get the journal associated with the slice of life. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Journal, $this> */ public function journal(): BelongsTo { return $this->belongsTo(Journal::class); } /** * Get the posts associated with the slice of life. * * @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Post, $this> */ public function posts(): HasMany { return $this->hasMany(Post::class); } /** * Get the file associated with the slice of life. * If it exists, it's the header image. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\File, $this> */ public function file(): BelongsTo { return $this->belongsTo(File::class, 'file_cover_image_id'); } }