I have checkIn function in LoginController:
LoginController.php with Path :
Controllers/Backsite/LoginController
public function checkIn(Request $request, User $user)
{
...
}
Already defined them in web.php
Route::group(['prefix' => 'backsite', 'as' => 'backsite.', 'middleware' => ['auth:sanctum', 'verified']], function(){
Route::get('/login/checkIn', [LoginController::class, 'checkIn']);
});
I call them from button in blade.php by using:
<button type="button" class="btn btn-primary btn-min-width mr-1 mb-1" href={{ route('backsite.login.checkIn') }}>CheckIn</button>
<button type="button" class="btn btn-info btn-min-width mr-1 mb-1" href={{ route('backsite.login.checkOut') }}>CheckOut</button>
But I shows me error that
Route [backsite.login.checkIn] not defined.
Im using Laravel 8, and already tried any other I found in Stackoverflow but still giving me Error
>Solution :
"Route not defined error" occur when you are trying to use route which is not defined please updated your code and defined route in path.
Route::group(['prefix' => 'backsite', 'as' => 'backsite.', 'middleware' => ['auth:sanctum', 'verified']], function(){
Route::get('/login/checkIn', [LoginController::class, 'checkIn'])->name('login.checkIn');
});