Преглед на файлове

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'));