Laravel - view does not work [closed]

1

I'm having problems: I'm editing a site and the Laravel view is only working in / and when I put another type http://localhost/blog/public/Termos it gives as it had not found codig routes:

Route::get('/', 'SiteController@index');
Route::get('/Contato', 'SiteController@Contrat');
Route::get('/Dicas', 'SiteController@Dicas');
Route::get('/Regulamento', 'SiteController@Regulamento');
Route::get('/Termos', 'SiteController@Termos');
Route::get('/Tutorial', 'SiteController@Tutorial');
Route::get('/Cadastro', 'SiteController@Cadastro');

SiteController code:

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class SiteController extends Controller
{
    public function index(){
        return view('/site.Home.index') ;
    }
    public function Contrato(){
        return view('/site.Contrato.index') ;
    }
    public function Dicas(){
        return view('/site.Dicas.index') ;
    }
    public function Regulamento(){
        return view('/site.Regulamento.index') ;
    }
    public function Termos(){
        return view('/site.Termos.index') ;
    }
    public function Tutorial(){
        return view('/site.Tutorial.index') ;
    }
    public function Cadastro(){
        return view('/site.Cadastro.index') ;
    }
}

Print the error that paginanot speaks

Butthearticleexists:

The strange thing is that if I change the location of the:

public function index(){
            return view('/site.Home.index') ;
        }

By:

public function index(){
            return view('/site.Termos.index') ;
        }

He finds the page and if I do the same procedure on Route::get and change the command Route::get('/', 'SiteController@index'); to Route::get('/', 'SiteController@Termos'); it usually finds the stranger just want to run /

    
asked by anonymous 21.06.2018 / 20:55

1 answer

0

Dude, try to stop php artisan serve and then start it again. And start again. I already had problems and it was the cache, when I created new routes with the active serves. If it does not work, clear the configuration caches with:

php artisan cache:clear
php artisan config:clear

Ah, extra tip. Pay attention to your other route: Route::get('/Contato', 'SiteController@Contrat'); You are calling it by the url Contact instead of Contract and when passing to the controller you are looking for a Contrat method instead of Contract.

Edit: I saw your comment now that you had to restart the machine, so the answer was the same cache. It's good that it worked.

    
22.06.2018 / 03:09