diff --git a/backend/app/User/Controllers/CityController.php b/backend/app/User/Controllers/CityController.php new file mode 100755 index 00000000..8ac7e042 --- /dev/null +++ b/backend/app/User/Controllers/CityController.php @@ -0,0 +1,18 @@ +json(City::all(['id', 'name'])); + } +} diff --git a/backend/app/User/Controllers/ProvinceController.php b/backend/app/User/Controllers/ProvinceController.php new file mode 100755 index 00000000..0d340730 --- /dev/null +++ b/backend/app/User/Controllers/ProvinceController.php @@ -0,0 +1,17 @@ +json(Province::all(['id', 'name'])); + } +} diff --git a/backend/routes/web.php b/backend/routes/web.php index b4048d81..64cea66a 100755 --- a/backend/routes/web.php +++ b/backend/routes/web.php @@ -6,7 +6,9 @@ use App\Admin\Controllers\RoleManagementController; use App\Admin\Controllers\UserManagementController; use App\User\Controllers\AuthController; use App\User\Controllers\GatewayManagementController; +use App\User\Controllers\CityController; use App\User\Controllers\ProfileController; +use App\User\Controllers\ProvinceController; use Illuminate\Support\Facades\Route; Route::prefix('auth') @@ -39,3 +41,17 @@ Route::prefix('user_gateway') Route::post('/{gateway}', 'update')->name('update'); Route::delete('/{gateway}', 'destroy')->name('destroy'); }); + +Route::prefix('province') + ->name('province.') + ->controller(ProvinceController::class) + ->group(function () { + Route::get('list', 'list')->name('list'); + }); + +Route::prefix('city') + ->name('city.') + ->controller(CityController::class) + ->group(function () { + Route::get('list', 'list')->name('list'); + });