feat: harden tenant settings and import pipeline

This commit is contained in:
2025-09-25 11:50:18 +02:00
parent b22d91ed32
commit 9248d7a3f5
29 changed files with 577 additions and 293 deletions

View File

@@ -2,13 +2,15 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Facades\Storage;
class Photo extends Model
{
use HasFactory;
protected $table = 'photos';
protected $guarded = [];
protected $casts = [
@@ -16,14 +18,12 @@ class Photo extends Model
'metadata' => 'array',
];
// Accessor für die Kompatibilität mit der PhotoResource
public function getImagePathAttribute()
public function getImagePathAttribute(): ?string
{
return $this->file_path;
}
// Mutator für die Kompatibilität mit der PhotoResource
public function setImagePathAttribute($value)
public function setImagePathAttribute(string $value): void
{
$this->attributes['file_path'] = $value;
}
@@ -33,19 +33,19 @@ class Photo extends Model
return $this->belongsTo(Event::class);
}
public function emotion()
public function emotion(): BelongsTo
{
return $this->belongsTo(Emotion::class);
}
public function task()
public function task(): BelongsTo
{
return $this->belongsTo(Task::class);
}
public function likes(): HasMany
{
return $this->hasMany(\App\Models\PhotoLike::class);
return $this->hasMany(PhotoLike::class);
}
}