Moved video files to public/videos directory, small refactoring.
This commit is contained in:
@@ -46,7 +46,9 @@ class Chapter extends Model
|
||||
protected function videoUrl(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn() => url($this->course_id . '/' . $this->order . '.mp4')
|
||||
get: fn() => url(
|
||||
'videos' . DIRECTORY_SEPARATOR . $this->course_id . DIRECTORY_SEPARATOR . $this->order . '.mp4'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -60,7 +62,7 @@ class Chapter extends Model
|
||||
protected function directoryPath(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn() => public_path($this->course_id)
|
||||
get: fn() => public_path('videos' . DIRECTORY_SEPARATOR . $this->course_id)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user