*/ protected $fillable = [ 'name', 'site_id', ]; /** * Perform any actions required after the model boots. * * @return void */ protected static function booted(): void { static::creating(function (self $model) { $model->assertFieldIsUnique('site_id', $model->site_id); }); static::updating(function (self $model) { throw new \RuntimeException('Updating an archived site is not authorized'); }); static::deleting(function () { throw new \RuntimeException('Deleting an archived site is not authorized'); }); } // * RELATIONS /** * ArchiveCampaign model relation * @return Illuminate\Database\Eloquent\Relations\HasMany */ public function archiveCampaign() { return $this->hasMany(ArchiveCampaign::class); } }