The problem
I use Homestead and I have an images
folder under public
, and there is a JPG called about_us-employee_1_image.jpg
. If I try to open it under its proper URL: http://project.local/images/about_us-employee_1_image.jpg
I get a NotFoundHttpException
. This happens with only this particular image and only with this specific name. If I change any of its characters it suddenly works again.
Failed solution attempts
The problem is not related to routing because I deleted all of my routes and it still happening. I ran php composer.phar dump-autoload
with no success. File and folder permissions are OK (this couldn't be the problem anyway, cause renaming wouldn't solve it).
Is there some kind of rule for naming assets that I'm unaware of?
Stack trace
NotFoundHttpException in compiled.php line 8257:
- in compiled.php line 8257
- at RouteCollection->match(object(Request)) in compiled.php line 7496
- at Router->findRoute(object(Request)) in compiled.php line 7461
- at Router->dispatchToRoute(object(Request)) in compiled.php line 7453
- at Router->dispatch(object(Request)) in compiled.php line 2302
- at Kernel->Illuminate\Foundation\Http{closure}(object(Request))
- at call_user_func(object(Closure), object(Request)) in compiled.php line 9585
- at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in compiled.php line 2926
- at VerifyCsrfToken->handle(object(Request), object(Closure))
- at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9577
- at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in compiled.php line 12949
- at ShareErrorsFromSession->handle(object(Request), object(Closure))
- at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9577
- at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in compiled.php line 11536
- at StartSession->handle(object(Request), object(Closure))
- at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9577
- at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in compiled.php line 12686
- at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
- at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9577
- at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in compiled.php line 12623
- at EncryptCookies->handle(object(Request), object(Closure))
- at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9577
- at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in compiled.php line 2983
- at CheckForMaintenanceMode->handle(object(Request), object(Closure))
- at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9577
- at Pipeline->Illuminate\Pipeline{closure}(object(Request))
- at call_user_func(object(Closure), object(Request)) in compiled.php line 9567
- at Pipeline->then(object(Closure)) in compiled.php line 2249
- at Kernel->sendRequestThroughRouter(object(Request)) in compiled.php line 2232
- at Kernel->handle(object(Request)) in index.php line 54
php artisan cache:clear
– Erich