made the video cards components
This commit is contained in:
1 parent
3aa49d638d
commit
72e9439727
16 files changed
+3973
-250
No files matched your search
@@ -21,6 +21,7 @@ class Video extends Model
|
||||
'height',
|
||||
'status',
|
||||
'visibility',
|
||||
'type',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
@@ -137,5 +138,30 @@ class Video extends Model
|
||||
}
|
||||
return $query->where('visibility', '!=', 'private');
|
||||
}
|
||||
|
||||
// Video type helpers
|
||||
public function getTypeIconAttribute()
|
||||
{
|
||||
return match($this->type) {
|
||||
'music' => 'bi-music-note',
|
||||
'match' => 'bi-trophy',
|
||||
default => 'bi-film',
|
||||
};
|
||||
}
|
||||
|
||||
public function isGeneric()
|
||||
{
|
||||
return $this->type === 'generic';
|
||||
}
|
||||
|
||||
public function isMusic()
|
||||
{
|
||||
return $this->type === 'music';
|
||||
}
|
||||
|
||||
public function isMatch()
|
||||
{
|
||||
return $this->type === 'match';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user