2024-06-10 12:21:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use App\Http\Controllers\FileController;
|
|
|
|
use App\Http\Controllers\FormsController;
|
|
|
|
use App\Http\Controllers\GeneralFormController;
|
|
|
|
use App\Http\Controllers\ProfileController;
|
|
|
|
use App\Http\Controllers\WebsiteController;
|
|
|
|
use App\Models\Enquiries;
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
use Symfony\Component\Process\Exception\ProcessFailedException;
|
|
|
|
use Symfony\Component\Process\Process;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| 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::post('/form/submit', [FormsController::class, 'handleFormSubmission'])->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
|
2024-06-11 06:31:24 +00:00
|
|
|
// Route::get('/all-enquiries', function () {
|
|
|
|
// $data = Enquiries::where('status', 1)->latest()->with('class')->get();
|
|
|
|
// return view('backend.enquiries-list', compact('data'));
|
|
|
|
// })->name('enquiries-list');
|
2024-06-10 12:21:58 +00:00
|
|
|
|
2024-06-11 06:31:24 +00:00
|
|
|
// Route::delete('/enquiry/destory/{id}', function ($id) {
|
|
|
|
// $data = Enquiries::findOrFail($id)->delete();
|
|
|
|
// return redirect()->back();
|
|
|
|
// })->name('enquiry.destroy');
|
2024-06-10 12:21:58 +00:00
|
|
|
|
|
|
|
require __DIR__ . '/route.settings.php';
|
|
|
|
require __DIR__ . '/route.menulocations.php';
|
|
|
|
require __DIR__ . '/route.menuitems.php';
|
2024-06-15 16:38:54 +00:00
|
|
|
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';
|
2024-06-18 05:46:51 +00:00
|
|
|
require __DIR__ . '/route.videos.php';
|
|
|
|
require __DIR__ . '/route.horoscope.php';
|
|
|
|
require __DIR__ . '/route.articles.php';
|
|
|
|
require __DIR__ . '/route.teams.php';
|
2024-06-18 10:41:58 +00:00
|
|
|
require __DIR__ . '/route.advertisements.php';
|
|
|
|
require __DIR__ . '/route.adcategories.php';
|
2024-06-20 10:57:33 +00:00
|
|
|
require __DIR__ . '/route.roles.php';
|
|
|
|
require __DIR__ . '/route.permissions.php';
|
|
|
|
require __DIR__ . '/route.users.php';
|
2024-06-18 10:41:58 +00:00
|
|
|
|
2024-06-10 12:21:58 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
require __DIR__ . '/route.client.php';
|
|
|
|
|
2024-06-11 12:03:42 +00:00
|
|
|
// Route::fallback([WebsiteController::class, 'fallback']);
|
2024-06-10 12:21:58 +00:00
|
|
|
|