Files
aso/Modules/Linksehat/Routes/api.php
Muhammad Fajar b477040fc1 api social login
2022-10-28 08:18:11 +07:00

53 lines
2.3 KiB
PHP

<?php
use Illuminate\Http\Request;
use Modules\Linksehat\Http\Controllers\Api\AuthController;
use Modules\Linksehat\Http\Controllers\Api\DashboardController;
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::get('dashboard/{default}/{limit?}', [DashboardController::class, 'index']);
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('social-login/{provider}', [AuthController::class, 'redirectSocialLogin']);
Route::get('social-login/{provider}/callback', [AuthController::class, 'handleSocialLoginCallback']);
// 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'])->name('doctors.online');
Route::get('doctors', [DoctorController::class, 'index'])->name('doctors.index');
Route::get('doctors/{id}', [DoctorController::class, 'show'])->name('doctors.show');
Route::post('doctors/{id}/schedule', [DoctorController::class, 'schedule'])->name('doctors.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');
});
});