belongsTo(Course::class); } protected function videoPath(): Attribute { return Attribute::make( get: fn() => $this->directory_path . '/' . $this->id . '.' . $this->link . '.mp4' ); } protected function directoryPath(): Attribute { return Attribute::make( get: fn() => $this->course_id . '.' . $this->course->link ); } protected function isVideoFile(): Attribute { return Attribute::make( get: fn() => is_file($this->video_path) ); } }