feat: harden tenant settings and import pipeline
This commit is contained in:
@@ -11,21 +11,13 @@ class TaskCollection extends Model
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'task_collections';
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
'tenant_id',
|
||||
'name',
|
||||
'description',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'name' => 'array',
|
||||
'description' => 'array',
|
||||
];
|
||||
|
||||
/**
|
||||
* Tasks in this collection
|
||||
*/
|
||||
public function tasks(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
@@ -36,9 +28,6 @@ class TaskCollection extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Events that use this collection
|
||||
*/
|
||||
public function events(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
@@ -48,24 +37,5 @@ class TaskCollection extends Model
|
||||
'event_id'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the localized name for the current locale
|
||||
*/
|
||||
public function getLocalizedNameAttribute(): string
|
||||
{
|
||||
$locale = app()->getLocale();
|
||||
return $this->name[$locale] ?? $this->name['de'] ?? 'Unnamed Collection';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the localized description for the current locale
|
||||
*/
|
||||
public function getLocalizedDescriptionAttribute(): ?string
|
||||
{
|
||||
if (!$this->description) return null;
|
||||
|
||||
$locale = app()->getLocale();
|
||||
return $this->description[$locale] ?? $this->description['de'] ?? null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user