From 9635f686d30d86ac98d0b5f17308d71b024a6396 Mon Sep 17 00:00:00 2001
From: Sam Light <samlight1994@gmail.com>
Date: Wed, 7 Sep 2022 10:31:49 +0100
Subject: Fixed route prefix issues

---
 routes/web.php | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'routes')

diff --git a/routes/web.php b/routes/web.php
index 8613ef7..b6abc4f 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -17,12 +17,14 @@ Route::name('scorm-player.')->prefix(config('scorm.route_prefix'))->middleware([
             Route::post('{tracking}', 'scormCommit')->name('scorm.commit');
         });
 
-        Route::prefix(config('scorm.route_prefix_player'))
-             ->get('{module:uuid}', 'player')
+        $prefix = config('scorm.route_prefix_player');
+        $prefix = rtrim($prefix, '/');
+        Route::get("{$prefix}/{module:uuid}", 'player')
              ->name('player');
 
-        Route::prefix(config('scorm.route_prefix_files'))
-             ->get('{uuid}/{path}', 'serveModule')
+        $prefix = config('scorm.route_prefix_files');
+        $prefix = rtrim($prefix, '/');
+        Route::get("{$prefix}/{uuid}/{path}", 'serveModule')
              ->where('path', '.*')
              ->name('serve');
     };
-- 
cgit v1.2.3