20-02-2026
This commit is contained in:
parent
854ce02bf6
commit
4d6b4930b2
128 changed files with 18247 additions and 2093 deletions
36
app/Models/Media.php
Normal file
36
app/Models/Media.php
Normal 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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue