57 lines
1.6 KiB
PHP
57 lines
1.6 KiB
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Support\Facades\Route;
|
||
|
use App\Http\Controllers\EnrollUserController;
|
||
|
use App\Http\Controllers\UsersListController;
|
||
|
|
||
|
/*
|
||
|
|--------------------------------------------------------------------------
|
||
|
| Web Routes
|
||
|
|--------------------------------------------------------------------------
|
||
|
|
|
||
|
| Here is where you can register web routes for your application. These
|
||
|
| routes are loaded by the RouteServiceProvider and all of them will
|
||
|
| be assigned to the "web" middleware group. Make something great!
|
||
|
|
|
||
|
*/
|
||
|
|
||
|
Route::get('/', function () {
|
||
|
return view('home');
|
||
|
});
|
||
|
|
||
|
|
||
|
Route::post('/enroll-user', [EnrollUserController::class, 'enrollUserAction'])->middleware('auth')->name('enroll-user');
|
||
|
|
||
|
Route::get('/users-list', [UsersListController::class, 'listUsersAction'])->middleware('auth')->name('users-list');
|
||
|
|
||
|
Route::get('/add-user', function (Request $request) {
|
||
|
return view('add-user');
|
||
|
})->middleware('auth')->name('add-user');
|
||
|
|
||
|
|
||
|
Route::get('/recordings', function () {
|
||
|
$recordingsDirectory = storage_path('app/recordings');
|
||
|
$recordings = File::allFiles($recordingsDirectory);
|
||
|
|
||
|
return view('recordings', [
|
||
|
'recordings' => $recordings
|
||
|
]);
|
||
|
})->middleware('auth')->name('recordings');
|
||
|
|
||
|
Route::get('/recordings/{filename}', function ($filename) {
|
||
|
$recordingsDirectory = storage_path('app/recordings');
|
||
|
$filePath = $recordingsDirectory . '/' . $filename;
|
||
|
|
||
|
$headers = [
|
||
|
'Content-Type' => 'video/mp4'
|
||
|
];
|
||
|
|
||
|
return Response::file($filePath, $headers);
|
||
|
})->name('play-recording');
|
||
|
|
||
|
|
||
|
|
||
|
Auth::routes();
|
||
|
|
||
|
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|