Redirect Route direct to the view

1

I've read in some places that the correct way is to point the route to a controller and then redirect to a view . I do this even when I will not pass any variables to this view ?

In this case, I will have a "about us" page where you will only have a static text describing the company, it is wrong for route to redirect to the view contains the text?

    
asked by anonymous 09.10.2017 / 23:43

1 answer

2

Not wrong, but it's not synonymous. You can do this by creating the route:

Route::post('/sobre-nos', function(){
     return view('sobrenos');
}

The "correct" would be to call the controller:

Route::post('/sobre-nos', 'SiteController@sobrenos');

And in the controller create the method about us:

public function sobrenos(){
     return view('sobrenos')
}
    
10.10.2017 / 03:17