23-01-2026
This commit is contained in:
parent
07959c0ba2
commit
854ce02bf6
166 changed files with 32909 additions and 1262 deletions
38
app/Models/DisplayVideo.php
Normal file
38
app/Models/DisplayVideo.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DisplayVideo extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'filename',
|
||||
'title',
|
||||
'position',
|
||||
'sort_order',
|
||||
'is_active',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_active' => 'boolean',
|
||||
'position' => 'integer',
|
||||
'sort_order' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* Scope für aktive Videos in sortierter Reihenfolge
|
||||
*/
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('is_active', true)->orderBy('sort_order');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt den vollständigen Pfad zum Video zurück
|
||||
*/
|
||||
public function getFullPathAttribute(): string
|
||||
{
|
||||
return "assets/{$this->filename}";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue