diff options
Diffstat (limited to 'routes/web.php')
-rw-r--r-- | routes/web.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/routes/web.php b/routes/web.php new file mode 100644 index 0000000..b86d710 --- /dev/null +++ b/routes/web.php @@ -0,0 +1,29 @@ +<?php + +use Illuminate\Support\Facades\Route; + +//use Illuminate\Routing\Middleware\SubstituteBindings; + +use Lightscale\ScormPlayer\Http\Controllers\ScormPlayerController; + +Route::name('scorm-player.')->prefix('elearning')->middleware([ + 'web', +])->group(function() { + + $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 = Route::controller(ScormPlayerController::class); + $middleware = config('scorm.middleware'); + + if(!empty($middleware)) { + $route->middleware($middleware); + } + + $route->group($group); +}); |