Files
aso/Modules/Linksehat/Routes/api.php
2022-09-20 09:31:26 +07:00

46 lines
1.9 KiB
PHP

<?php
use Illuminate\Http\Request;
use Modules\Linksehat\Http\Controllers\Api\AuthController;
use Modules\Linksehat\Http\Controllers\Api\DoctorController;
use Modules\Linksehat\Http\Controllers\Api\HospitalController;
use Modules\Linksehat\Http\Controllers\Api\ProfileController;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::prefix('linksehat')->group(function () {
Route::post('otp-request', [AuthController::class, 'otpRequest']);
Route::post('mock-otp', [AuthController::class, 'mockOtp']);
Route::post('login', [AuthController::class, 'login']);
Route::post('register', [AuthController::class, 'register']);
// Route::get('articles', [ArticleController::class, 'index']);
// Route::get('articles/id', [ArticleController::class, 'show']);
Route::get('hospitals', [HospitalController::class, 'index']);
Route::get('hospitals/{id}', [HospitalController::class, 'show']);
Route::get('doctors/online', [DoctorController::class, 'index']);
Route::get('doctors', [DoctorController::class, 'index']);
Route::get('doctors/{id}', [DoctorController::class, 'show']);
Route::get('doctors/{id}/schedule', [DoctorController::class, 'schedule']);
// Route::middleware('auth:api')->get('/linksehat', function (Request $request) {
// return $request->user();
// });
Route::middleware('auth:sanctum')->group(function () {
Route::get('profile', [ProfileController::class, 'index'])->name('profile');
Route::post('profile', [ProfileController::class, 'update'])->name('profile.update');
});
});