Static Pages

By | 05/12/2019

There’s pretty much always a need to some standard static pages and I usually create a home, about, contact (with form), FAQ and blog

The rails command for this is

$ rails g controller Pages home about contact faq blog

Translating to laravel we have

$ php artisan:make controller Pages

We don’t have the capability to create a controller with views, I may find a way to do it later… Rails wins out this time! However you can just route to the view themselves so I suppose you technically don’t need a controller.

Create a ‘pages’ directory in resources/views and move welcome.blade.php to the pages directoty, renaming it to home.blade.php. Duplicate home.blade.php and rename each until you have about, contact, faq & blog – each with a .blade.php suffix.