1

Problem: When i access non existing route it shows 404 page except site.com/admin, it shows blank page.

my web.php file,

    Route::group(['prefix' => 'admin', 'middleware'=>'auth:admin'], function () {

        Route::POST('readnotification','NotificationController@readnotification')->name('readnotification');

        Route::GET('/home','AdminController@index')->name('admin.dashboard');
....

Full web.php file is here https://pastebin.com/embed_js/pZNmPih8

Tried:

1) I have seen php artisan route:list, /admin route is not exist.

2) I removed all routes, and accessed a non existing route then it shows 404 page, except site.com/admin, as usual it shows blank page.

3) Even i emptied the web.php file, but still /admin is blank and other urls going to 404

I really don't know whats happening.

arun
  • 4,595
  • 5
  • 19
  • 39

2 Answers2

1

Make sure you have not created any directory inside public/ as same as your route name. If you have /admin directory inside public/ then your /admin route will not work and show blank page without any error. Anything inside public/ directory will not show as 404 page instead of that it will show a blank page

bairavand
  • 335
  • 3
  • 11
0

As you commented that you have below route to get work if you go to /admin

     Route::get('/home','AdminController@index')->name('admin.dashboard');

Then it should be just / inside admin group , or add it as another route to get both route work

    Route::get('/','AdminController@index')->name('admin.dashboard');
Niklesh Raut
  • 34,013
  • 16
  • 75
  • 109