name("form.submit"); require __DIR__ . '/auth.php'; Route::middleware('auth')->group(function () { Route::post('/upload', [FileController::class, 'upload'])->name('upload'); Route::group(['prefix' => 'files', 'middleware' => ['web', 'auth']], function () { \UniSharp\LaravelFilemanager\Lfm::routes(); }); Route::middleware('auth')->get('/dashboard', function () { return view('backend.dashboard'); }); Route::middleware('auth')->prefix('admin')->group(function () { Route::get('/dashboard', function () { return view('backend.dashboard'); }); Route::get('/', function () { return view('backend.dashboard'); })->name('admin.dashboard'); Route::get('/backup', function () { $databaseName = env('DB_DATABASE'); $backupFileName = 'backup_' . date('Y-m-d_His') . '.sql'; $backupPath = storage_path('app/' . $backupFileName); // Create the mysqldump command as an array $command = [ 'mysqldump', '--user=' . env('DB_USERNAME'), '--password=' . env('DB_PASSWORD'), '--host=' . env('DB_HOST'), $databaseName, ]; // Run the mysqldump command using Symfony Process $process = new Process($command); $process->setOutputFile($backupPath); $process->run(); if (!$process->isSuccessful()) { throw new ProcessFailedException($process); } // Provide the download link for the backup file return response()->download($backupPath)->deleteFileAfterSend(true); })->name('backup.db'); }); Route::prefix("form")->group(function () { Route::get('/tables', [GeneralFormController::class, 'tables'])->name('form.tables'); Route::get('/', [GeneralFormController::class, 'create'])->name('form.create'); Route::get('/store', [GeneralFormController::class, 'store'])->name('form.store'); Route::get('/make-table-nullable', [GeneralFormController::class, 'getTableNullablecreate'])->name('table.create'); Route::get('/store', [GeneralFormController::class, 'store'])->name('form.store'); }); Route::get('/shortcodes', function () { return view("backend.shortcodes"); })->name('shortcodes'); Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit'); Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update'); Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy'); //get all enquiries // Route::get('/all-enquiries', function () { // $data = Enquiries::where('status', 1)->latest()->with('class')->get(); // return view('backend.enquiries-list', compact('data')); // })->name('enquiries-list'); // Route::delete('/enquiry/destory/{id}', function ($id) { // $data = Enquiries::findOrFail($id)->delete(); // return redirect()->back(); // })->name('enquiry.destroy'); require __DIR__ . '/route.settings.php'; require __DIR__ . '/route.menulocations.php'; require __DIR__ . '/route.menuitems.php'; require __DIR__ . '/route.provinces.php'; require __DIR__ . '/route.news_type.php'; require __DIR__ . '/route.newscategories.php'; require __DIR__ . '/route.news.php'; require __DIR__ . '/route.authors.php'; require __DIR__ . '/route.economies.php'; require __DIR__ . '/route.videos.php'; require __DIR__ . '/route.horoscope.php'; require __DIR__ . '/route.articles.php'; require __DIR__ . '/route.teams.php'; require __DIR__ . '/route.advertisements.php'; require __DIR__ . '/route.adcategories.php'; require __DIR__ . '/route.roles.php'; require __DIR__ . '/route.permissions.php'; require __DIR__ . '/route.users.php'; }); require __DIR__ . '/route.client.php'; // Route::fallback([WebsiteController::class, 'fallback']);