Updated composer packaged, updated home view table.

This commit is contained in:
Krzysztof Płaczek
2023-03-31 08:44:31 +02:00
parent 5784cf8ed3
commit dce3cdd929
4 changed files with 558 additions and 388 deletions

View File

@@ -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),
);
}
}