Updated composer packaged, updated home view table.
This commit is contained in:
1 parent
5784cf8ed3
commit
dce3cdd929
4 files changed
+558
-388
No files matched your search
+10
-3
@@ -45,17 +45,24 @@ class Course extends Model
|
||||
return $this->hasMany(Chapter::class);
|
||||
}
|
||||
|
||||
public function totalSize(): Attribute
|
||||
protected function totalSize(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn() => $this->chapters->sum('video_size'),
|
||||
);
|
||||
}
|
||||
|
||||
public function totalSizeHuman(): Attribute
|
||||
protected function tracks(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn() => formatFileSize($this->total_size),
|
||||
get: fn(string $tracks) => empty($tracks) ? [] : explode(',', $tracks),
|
||||
);
|
||||
}
|
||||
|
||||
protected function totalSizeHuman(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn() => formatFileSize($this->total_size),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user