Greetings, I'm working on Laravel 5.3 and none of my routes work, the only one that works is the root route '/'
, I don't understand why.
web.php
<?php
Route::get('/',function(){
return view("certificado.index");
});
/*Route::get("certificado",function(){
dd("Saludos");
});*/
Route::resource("certificado",'CertificadoGarantiaController');
When I enter the route http://localhost/baterias/public/certificado
, the only thing it shows me is the error:
NotFoundHttpException in RouteCollection.php line 161
And so with any other route I create.
I already tried things like
php artisan cache:clear
php artisan config:cache
composer dump-autoload
composer update
And nothing still keeps getting the same error.
edit route:list
Mistake
Route'/'
CertificateGuaranteeController index
public function index()
{
dd("hola");
}
After arguing in chat, we managed to determine that it was a routing mix-up between Apache and Laravel:
http://localhost/baterias/public/certificado
./public/
.Taking into account that I have not worked Laravel with Apache (only with Nginx), I propose two solutions to this problem:
Create a VirtualHost in Apache for the project, as suggested in the following link:
Use Homestead (Vagrant) or Docker to completely virtualize the development environment and avoid problems with the "local" machine.