*/ protected $fillable = [ 'question', 'answer', 'theme_id' ]; /** * The relations to eager load on every query. * * @var array */ protected $with = ['theme']; // * EVENTS /** * Perform any actions required after the model boots. * * @return void */ protected static function booted() { static::created(fn () => self::removeCached()); static::updated(fn () => self::removeCached()); static::deleted(fn () => self::removeCached()); } // * RELATIONS /** * Theme relation * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function theme(): BelongsTo { return $this->belongsTo(FaqTheme::class, 'theme_id'); } /** * Activities logs One-to-many relationship. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function activityLogs(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(ActivityLog::class); } }