浏览代码

Added dynamic routing for reports

ttreasure 4 月之前
父节点
当前提交
b8e847b59b
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      routes/web.php

+ 2 - 2
routes/web.php

@@ -2,9 +2,9 @@
 
 use Illuminate\Support\Facades\Route;
 
-Route::get('/', function (){
+Route::get('/reports/{report}', function ($report){
         // Fetch the datatable name dynamically from the database (replace with your logic)
-        $datatableName = DB::table('datatables')->where('name', '=', 'Employee-Report')->value('name');
+        $datatableName = DB::table('datatables')->where('name', '=', $report)->value('name');
         // Pass it to the view
         return view('MainView', compact('datatableName'));