gocevskam's avatar

The requested resource was not found on this server, when it is there and worked fine earlier

Hello, I have this problem for a 3rd time. I am following on the tutorial for ProjectFlyer with Laravel 5.1. (When it didn't worked I started over again).

I am using the laravel built in server locally. And I was able to save a flyer 5 minutes ago. I did go back multiple times to save again and again and now it just doesn't work. I have those routes.

Route::resource('flyers', 'FlyerController');
Route::get('{title}','FlyerController@show' );
Route::post('{title}/photos','FlyerController@addPhoto' );

Anybody can help me?

0 likes
21 replies
garyobrien's avatar

same i now cannot post a flyer form it says The requested resource /flyers was not found on this server.

Does anyone know why?

jlrdw's avatar

Did you change any code, is your server down.

1 like
fmkhalili86@gmail.com's avatar

Ok, for anyone interested I found the issue. The base directory to save flyers images is /flyers/photos and it's somehow making problem with the route to /flyer. Changed the folder name and is good now.

6 likes
poboy's avatar

You changed this part in the photo.php file? protected $baseDir = 'flyers/photos';

I'm still having the same issue everyone else did.

Hamdambek's avatar

It may that under public you have a folder name as admin. That can be source of your problems. in the folder "ROOT/public/" possible exist "flyers" folder. rename "flyers" to other name. the problem is ok

dmytro23's avatar

@helpmyworld також вирішило мою проблему, потрібно перейменувати URL..

anmoldev's avatar

Don't ever make the file name of controller ,router and view the same and it will be fine then.

Hadayat's avatar

@gocevskam

That error occurs when you create a folder in the public folder with the same name as your route so please change the name of the folder you have put in the public folder so that it has a different name from your route this will probably solve your error.

2 likes
musheabdulhakim's avatar

This happens when you have a folder in the public folder with the same name as your route. You can solve this by renaming the folder or changing the route. like : Route::get('flyer',[Controller::class,'method']); instead of

Route::get('flyers',[Controller::class,'method']);

5 likes
mokaddes's avatar

In the public directory, there may be a folder named same as url.

Please or to participate in this conversation.