TALL Tales

Basic Controllers and Routing for Static Pages in Laravel

01 Feb, 2021

For static pages it isn’t worth following the RESTful conventions.

Instead, just set up a PageController and use actions such as these:

  • PagesController@about
  • PagesController@contact

e.g.

public function about()
    {
        return view('about');
    }

In your routes/web.php, write this:

Route::get('/about', 'PageController@about')->name('pages.about');