location/routes/web.php

46 lines
2.5 KiB
PHP

<?php
use Illuminate\Support\Facades\Route;
use Modules\Location\Http\Controllers\CitiesController;
use Modules\Location\Http\Controllers\DistrictsController;
use Modules\Location\Http\Controllers\LocationController;
use Modules\Location\Http\Controllers\ProvincesController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::middleware(['auth'])->group(function () {
Route::name('locations.')->prefix('locations')->group(function () {
Route::name('provinces.')->prefix('provinces')->group(function () {
Route::get('restore/{id}', [ProvincesController::class, 'restore'])->name('restore');
Route::get('datatables', [ProvincesController::class, 'dataForDatatables'])->name('datatables');
Route::get('export', [ProvincesController ::class, 'export'])->name('export');
});
Route::resource('provinces', ProvincesController::class);
Route::name('cities.')->prefix('cities')->group(function () {
Route::get('restore/{id}', [CitiesController::class, 'restore'])->name('restore');
Route::get('datatables', [CitiesController::class, 'dataForDatatables'])->name('datatables');
Route::get('export', [CitiesController ::class, 'export'])->name('export');
Route::get('province/{province_code}', [CitiesController::class, 'getCitiesByProvinceId'])->name('province');
});
Route::resource('cities', CitiesController::class);
Route::name('districts.')->prefix('districts')->group(function () {
Route::get('restore/{id}', [DistrictsController::class, 'restore'])->name('restore');
Route::get('datatables', [DistrictsController::class, 'dataForDatatables'])->name('datatables');
Route::get('export', [DistrictsController ::class, 'export'])->name('export');
Route::get('city/{city_code}', [DistrictsController::class, 'getDistrictsByCityId'])->name('city');
});
Route::resource('districts', DistrictsController::class);
});
});