Geekshop - 404 Error

jawad-ali

Jun 6th, 2017 06:37 AM

Hi Admin,

I have a problem regarding 404 error, I made and error file same as you mentioned "located at resources/views/errors/ then add a new file called 404.blade.php". But why its not working for "Category, product and page"

Like its working on this link "https://www.offily.com/show-me-error" but not on this link "https://www.offily.com/product/show-me-error"

How I can fix this ...

devdojo

Jun 7th, 2017 12:19 PM

Ok, It should be showing the 404 page now :)

I've updated this in your controller as well and will include it in the next release.

Instead of using this:

$product = Product::where('slug', '=', $slug)->where('active', '=', 1)->first();

In the app/Http/Controllers/ProductController.php, it should have been this:

$product = Product::where('slug', '=', $slug)->where('active', '=', 1)->firstOrFail();

So, if it doesn't find the product it will fail and return a 404, instead of a 500.

Hope that helps.

Thanks for letting me know about that issue :D

jawad-ali

Jun 8th, 2017 05:37 PM

Hi,

I Did the same for Category and Page "$category & $page" controllers and they are working fine now....

Thanks for your Help