Compare commits
4 Commits
feature/pa
...
5c757e1823
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c757e1823 | |||
| 9ad3d6cea0 | |||
| 8554f4cc55 | |||
| 5e48777e1c |
18
backend/app/User/Controllers/CityController.php
Executable file
18
backend/app/User/Controllers/CityController.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\City;
|
||||
use App\Traits\ApiResponse;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class CityController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
|
||||
public function list(): JsonResponse
|
||||
{
|
||||
return response()->json(City::all(['id', 'name']));
|
||||
}
|
||||
}
|
||||
17
backend/app/User/Controllers/ProvinceController.php
Executable file
17
backend/app/User/Controllers/ProvinceController.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Province;
|
||||
use App\Traits\ApiResponse;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class ProvinceController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
public function list(): JsonResponse
|
||||
{
|
||||
return response()->json(Province::all(['id', 'name']));
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,9 @@ use App\Admin\Controllers\PermissionManagementController;
|
||||
use App\Admin\Controllers\RoleManagementController;
|
||||
use App\Admin\Controllers\UserManagementController;
|
||||
use App\User\Controllers\AuthController;
|
||||
use App\User\Controllers\CityController;
|
||||
use App\User\Controllers\ProfileController;
|
||||
use App\User\Controllers\ProvinceController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::prefix('auth')
|
||||
@@ -26,3 +28,17 @@ Route::prefix('profile')
|
||||
Route::post('edit', 'edit')->name('edit');
|
||||
Route::post('change_password', 'changePassword')->name('changePassword');
|
||||
});
|
||||
|
||||
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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user