so this is my api.php
// Rute Publik
Route::post('register', [AuthController::class, 'register']);
Route::post('login', [AuthController::class, 'login']);
// Rute yang Memerlukan Token Akses
Route::middleware('auth:api')->group(function () {
Route::get('/user', [AuthController::class, 'user']);
Route::post('logout', [AuthController::class, 'logout']);
Route::get('pendaftar', [PendaftarController::class, 'index']); // List all pendaftar
Route::post('pendaftar', [PendaftarController::class, 'store']); // Create a new pendaftar
Route::get('pendaftar/{id}', [PendaftarController::class, 'show']); // Show a specific pendaftar
Route::post('updatependaftar/{id}', [PendaftarController::class, 'update']); // Update a specific pendaftar
Route::delete('pendaftar/{id}', [PendaftarController::class, 'destroy']); // Delete a specific pendaftar
Route::put('/pendaftar/{id}/konfirmasi-bayar', [PendaftarController::class, 'konfirmasiBayar']);
});
but when i want to run http://127.0.0.1:8000/api/pendaftar
On postman its say
SymfonyComponentRoutingExceptionRouteNotFoundException: Route [login] not defined.
and this is my auth.php
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'passport', // Menggunakan 'passport' sebagai driver untuk API
'provider' => 'users',
],
],
its seems hit the login route even when im tring to hit another api that using middleware,