108 lines
6.5 KiB
PHP
108 lines
6.5 KiB
PHP
<?php
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\Route;
|
|
use App\Http\Controllers\Backend\AdminsController;
|
|
use App\Http\Controllers\Backend\Auth\ForgotPasswordController;
|
|
use App\Http\Controllers\Backend\Auth\LoginController;
|
|
use App\Http\Controllers\GenerateDataMasterController;
|
|
use App\Http\Controllers\Backend\DashboardController;
|
|
use App\Http\Controllers\Backend\RolesController;
|
|
use App\Http\Controllers\Backend\MenuRoleController;
|
|
use App\Http\Controllers\Forms\FormUpCountryController;
|
|
use App\Http\Controllers\Master\RayonController;
|
|
use App\Http\Controllers\Master\CostCentreController;
|
|
use App\Http\Controllers\Master\CategoryController;
|
|
use App\Http\Controllers\Forms\FormVehicleController;
|
|
use App\Http\Controllers\Forms\FormEntertainmentPresentationController;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use App\Helpers\NextCloudHelper;
|
|
|
|
Auth::routes();
|
|
|
|
Route::group(['prefix' => 'admin', 'as' => 'admin.'], function () {
|
|
// Login Routes.
|
|
Route::post('/login/submit', [LoginController::class, 'login'])->name('login.submit');
|
|
Route::get('/login', [LoginController::class, 'showLoginForm'])->name('login');
|
|
// Logout Routes.
|
|
Route::post('/logout/submit', [LoginController::class, 'logout'])->name('logout.submit');
|
|
});
|
|
|
|
|
|
/**
|
|
* Admin routes
|
|
*/
|
|
Route::group(['prefix' => 'admin', 'as' => 'admin.', 'middleware' => ['auth:admin', 'menu']], function () {
|
|
Route::resource('admins', AdminsController::class);
|
|
Route::resource('roles', RolesController::class);
|
|
Route::get('/admin', [DashboardController::class, 'index'])->name('dashboard');
|
|
|
|
// Rayon
|
|
Route::get('/rayon', [RayonController::class, 'index'])->name('rayon.index');
|
|
Route::get('/rayon/create', [RayonController::class, 'create'])->name('rayon.create');
|
|
Route::post('/rayon/store', [RayonController::class, 'store'])->name('rayon.store');
|
|
Route::get('/rayon/edit/{id}', [RayonController::class, 'edit'])->name('rayon.edit');
|
|
Route::put('/rayon/update/{id}', [RayonController::class, 'update'])->name('rayon.update');
|
|
Route::delete('/rayon/destroy/{id}', [RayonController::class, 'destroy'])->name('rayon.destroy');
|
|
|
|
// Cost Centre
|
|
Route::get('/cost', [CostCentreController::class, 'index'])->name('cost.index');
|
|
Route::get('/cost/create', [CostCentreController::class, 'create'])->name('cost.create');
|
|
Route::post('/cost/store', [CostCentreController::class, 'store'])->name('cost.store');
|
|
Route::get('/cost/edit/{id}', [CostCentreController::class, 'edit'])->name('cost.edit');
|
|
Route::put('/cost/update/{id}', [CostCentreController::class, 'update'])->name('cost.update');
|
|
Route::delete('/cost/destroy/{id}', [CostCentreController::class, 'destroy'])->name('cost.destroy');
|
|
|
|
// Category
|
|
Route::get('/category', [CategoryController::class, 'index'])->name('category.index');
|
|
Route::get('/category/create', [CategoryController::class, 'create'])->name('category.create');
|
|
Route::post('/category/store', [CategoryController::class, 'store'])->name('category.store');
|
|
Route::get('/category/edit/{id}', [CategoryController::class, 'edit'])->name('category.edit');
|
|
Route::put('/category/update/{id}', [CategoryController::class, 'update'])->name('category.update');
|
|
Route::delete('/category/destroy/{id}', [CategoryController::class, 'destroy'])->name('category.destroy');
|
|
|
|
})->middleware(['auth:admin']);
|
|
|
|
Route::middleware(['auth:admin', 'menu'])->group(function () {
|
|
Route::get('/', [DashboardController::class, 'index'])->name('dashboard.index');
|
|
|
|
// Forms
|
|
Route::prefix('forms')->group(function () {
|
|
// Up Country
|
|
Route::get('/up-country', [FormUpCountryController::class, 'index'])->name('forms.up-country');
|
|
Route::get('/up-country/create', [FormUpCountryController::class, 'create'])->name('forms.up-country.create');
|
|
Route::post('/up-country/store', [FormUpCountryController::class, 'store'])->name('forms.up-country.store');
|
|
Route::get('/up-country/edit/{id}', [FormUpCountryController::class, 'edit'])->name('forms.up-country.edit');
|
|
Route::put('/up-country/update/{id}', [FormUpCountryController::class, 'update'])->name('forms.up-country.update');
|
|
Route::delete('/up-country/destroy/{id}', [FormUpCountryController::class, 'destroy'])->name('forms.up-country.destroy');
|
|
|
|
// Vehicle Running Cost
|
|
Route::get('/vehicle-running-cost', [FormVehicleController::class, 'index'])->name('forms.vehicle');
|
|
Route::get('/vehicle-running-cost/create', [FormVehicleController::class, 'create'])->name('forms.vehicle.create');
|
|
Route::post('/vehicle-running-cost/store', [FormVehicleController::class, 'store'])->name('forms.vehicle.store');
|
|
Route::get('/vehicle-running-cost/edit/{id}', [FormVehicleController::class, 'edit'])->name('forms.vehicle.edit');
|
|
Route::put('/vehicle-running-cost/update/{id}', [FormVehicleController::class, 'update'])->name('forms.vehicle.update');
|
|
Route::delete('/vehicle-running-cost/destroy/{id}', [FormVehicleController::class, 'destroy'])->name('forms.vehicle.destroy');
|
|
|
|
// Entertainment & Presentation
|
|
Route::get('/entertainment-presentation', [FormEntertainmentPresentationController::class, 'index'])->name('forms.entertainment');
|
|
Route::get('/entertainment-presentation/create', [FormEntertainmentPresentationController::class, 'create'])->name('forms.entertainment.create');
|
|
Route::post('/entertainment-presentation/store', [FormEntertainmentPresentationController::class, 'store'])->name('forms.entertainment.store');
|
|
Route::get('/entertainment-presentation/edit/{id}', [FormEntertainmentPresentationController::class, 'edit'])->name('forms.entertainment.edit');
|
|
Route::put('/entertainment-presentation/update/{id}', [FormEntertainmentPresentationController::class, 'update'])->name('forms.entertainment.update');
|
|
Route::delete('/entertainment-presentation/destroy/{id}', [FormEntertainmentPresentationController::class, 'destroy'])->name('forms.entertainment.destroy');
|
|
});
|
|
|
|
//Menu Role
|
|
Route::get('/auth/menu-tree/{id}', [MenuRoleController::class, 'index'])->name('auth.menurole.index');
|
|
Route::post('/auth/menu-tree/submit', [MenuRoleController::class, 'saveMenu'])->name('auth.menurole.submit');
|
|
});
|
|
|
|
Route::get('/test-nextcloud', function () {
|
|
$baseUrl = env('NEXT_CLOUD_URL');
|
|
$adminUsername = env('NEXT_CLOUD_USERNAME');
|
|
$adminPassword = env('NEXT_CLOUD_PASSWORD');
|
|
|
|
$response = NextCloudHelper::createFolder($baseUrl, $adminUsername, $adminPassword, 'test-folder');
|
|
dd($response);
|
|
});
|