first commit
This commit is contained in:
commit
6a2026df4b
87 files changed
+13271
No files matched your search
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Video extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'description',
|
||||
'filename',
|
||||
'path',
|
||||
'thumbnail',
|
||||
'duration',
|
||||
'size',
|
||||
'status',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'duration' => 'integer',
|
||||
'size' => 'integer',
|
||||
];
|
||||
|
||||
public function getUrlAttribute()
|
||||
{
|
||||
return asset('storage/videos/' . $this->filename);
|
||||
}
|
||||
|
||||
public function getThumbnailUrlAttribute()
|
||||
{
|
||||
if ($this->thumbnail) {
|
||||
return asset('storage/thumbnails/' . $this->thumbnail);
|
||||
}
|
||||
return asset('images/video-placeholder.jpg');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user