20-02-2026

This commit is contained in:
Kevin Adametz 2026-02-20 17:57:50 +01:00
parent 854ce02bf6
commit 4d6b4930b2
128 changed files with 18247 additions and 2093 deletions

36
app/Models/Media.php Normal file
View file

@ -0,0 +1,36 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
class Media extends Model
{
use HasFactory;
protected $fillable = [
'model_type',
'model_id',
'file_path',
'type',
'alt_text',
'order_column',
];
protected function casts(): array
{
return [
'order_column' => 'integer',
];
}
/**
* Polymorphe Beziehung zum Eltern-Model (Product, Partner, etc.).
*/
public function model(): MorphTo
{
return $this->morphTo();
}
}