dsn_public_key ??= Str::uuid()->toString(); $project->dsn_secret_key ??= Str::uuid()->toString(); }); } public function getDsnAttribute(): string { $host = config('app.url'); return "{$host}/api/{$this->id}/store/?sentry_key={$this->dsn_public_key}"; } public function users(): BelongsToMany { return $this->belongsToMany(User::class) ->withPivot('role') ->withTimestamps(); } public function issues(): HasMany { return $this->hasMany(Issue::class); } public function events(): HasMany { return $this->hasMany(Event::class); } public function alertRules(): HasMany { return $this->hasMany(AlertRule::class); } public function regenerateKeys(): void { $this->update([ 'dsn_public_key' => Str::uuid()->toString(), 'dsn_secret_key' => Str::uuid()->toString(), ]); } }