0

I'm working on a local laravel-nova project which worked fine the last couple of days. Now all of a sudden, when I try to go to the /nova route I get a 404 error saying Page could not be found. I tried with

php artisan config:cache

but with no luck. I even deleted the vendor-folder and ran composer install and php artisan nova:install but that didn't solve it either.

When I run php artisan route:list I get the error:

Class App\Http\Controllers\Laravel\Nova\Http\Controllers\LoginController does not exist

I mean, seriously - WTF??? I have absolutely no clue what happened?

Does anyone know how to solve this?

My Laravel version is 5.7 and I'm running this app on a Windows 10 machine.

ST80
  • 3,185
  • 10
  • 47
  • 98

7 Answers7

7

add on app/config/app.php

App\Providers\NovaServiceProvider::class,

inside 'providers'

you may need to run these commands later if that doesn't work

php artisan nova:publish

and

php artisan view:clear
ztvmark
  • 985
  • 11
  • 8
  • Yes - `php artisan nova:publish` was actually the thing that solved it! Forgot to mention it :-) Thanks anyway - I will accept your answer! – ST80 Mar 26 '20 at 08:20
1

I found it out myself, so just in case other users may have the same problem I'm gonna post an answer.

So, if you may have a route like for example:

Route::get('{subpage}', 'SubpagesController@show');

This will return the 404 and you will not be able to access Nova e.g. the dashboard since Nova (from version 1.0.9) is always registering its routes after the application's routes

You will have to change the config/nova.php path to either no/va or simply nova by removing the /

See here for more

ST80
  • 3,185
  • 10
  • 47
  • 98
1

This works for me, add the following code in your virtual host:

<Directory /var/www/html/checkin>
    AllowOverride All
</Directory>
Gass
  • 4,098
  • 2
  • 13
  • 27
0

LoginController This File Add use App\Http\Controllers\Controller;

0

Verify that the App\Providers\NovaServiceProvider was added to the providers array in your app\config.php configuration file. If it wasn't, you should add it manually. Of course, if your application does not use the App namespace, you should update the provider class name as needed.

0

You might want to try following commands in your terminal:

composer dump-autoload
php artisan clear-compiled
php artisan route:clear
php artisan config:cache
Lonare
  • 3,601
  • 31
  • 38
0

I am using laragon , In my case, In config/app.php add

App\Providers\NovaServiceProvider::class,

then tried

php artisan nova:publish

but still 404 error was coming, then following

composer dump-autoload
php artisan clear-compiled
php artisan route:clear
php artisan config:cache

worked! fine for me.

eak
  • 1
  • 1