belongsTo(Course::class); } protected function videoUrl(): Attribute { return Attribute::make( get: fn() => url($this->course_id . '/' . $this->order . '.mp4') ); } protected function videoPath(): Attribute { return Attribute::make( get: fn() => $this->directory_path . '/' . $this->order . '.mp4' ); } protected function directoryPath(): Attribute { return Attribute::make( get: fn() => public_path($this->course_id) ); } protected function isVideoFile(): Attribute { return Attribute::make( get: fn() => is_file($this->video_path) ); } public function videoSizeHuman(): Attribute { return Attribute::make( get: function () { return formatFileSize($this->video_size); }, ); } }