summaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2022-09-06 12:43:08 +0100
committerSam Light <samlight1994@gmail.com>2022-09-06 12:43:08 +0100
commitb602d6dbe1ad1a8507f09a4924d8a9ef4903a17e (patch)
tree866602a4d7a012bdb707cf0985a87ba44e094537 /routes
parentd5518bc1d5ccfaff9abec9f8486a1ee72ad65555 (diff)
Made all the routes configable
Diffstat (limited to 'routes')
-rw-r--r--routes/web.php24
1 files changed, 15 insertions, 9 deletions
diff --git a/routes/web.php b/routes/web.php
index 4570f11..8613ef7 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -2,23 +2,29 @@
use Illuminate\Support\Facades\Route;
-//use Illuminate\Routing\Middleware\SubstituteBindings;
-
use Lightscale\ScormPlayer\Http\Controllers\ScormPlayerController;
-Route::name('scorm-player.')->prefix('elearning')->middleware([
- 'web',
+Route::name('scorm-player.')->prefix(config('scorm.route_prefix'))->middleware([
+ config('scorm.middleware_group', 'web'),
])->group(function() {
Route::get('scorm-player-{version}.js', [ScormPlayerController::class, 'jsSource'])
->name('javascript');
$group = function() {
- Route::get('/scorm/{sco}', 'scormLoad')->name('scorm.load');
- Route::post('/scorm/{tracking}', 'scormCommit')->name('scorm.commit');
-
- Route::get('{module:uuid}', 'player')->name('player');
- Route::get('files/{uuid}/{path}', 'serveModule')->name('serve')->where('path', '.*');
+ Route::prefix(config('scorm.route_prefix_scorm'))->group(function() {
+ Route::get('{sco}', 'scormLoad')->name('scorm.load');
+ Route::post('{tracking}', 'scormCommit')->name('scorm.commit');
+ });
+
+ Route::prefix(config('scorm.route_prefix_player'))
+ ->get('{module:uuid}', 'player')
+ ->name('player');
+
+ Route::prefix(config('scorm.route_prefix_files'))
+ ->get('{uuid}/{path}', 'serveModule')
+ ->where('path', '.*')
+ ->name('serve');
};
$route = Route::controller(ScormPlayerController::class);