I have two users Admin/Customer for the admin he needs to logged in to the system before accessing the services. My code works fine after login. But if i just type the url "../admin" in the browser then it will show the above error. I am a beginner to laravel. I need a way of informing the user to sign-in before accessing this page without showing this error. I didn't find any way to do it. Following is my routes.php file and the related route code. What do i have to change in this route.php file. Many thanks in advance
Route::group(['middleware' => 'App\Http\Middleware\Admin'], function()
{
Route::get('/admin/home', function()
{
// can only access this if type == A which is used to redirect to admin dashboard
return view('Admin/admin');
});
});