Updated composer packaged, updated home view table.
This commit is contained in:
@@ -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