Adding a static page

I will cover how easy it is to add a static page. We will look at several approaches.

Getting started…

We have a base install from all the previous work done and an About link. We are going to make that work.

How to do it…

  1. I will show three ways. This first way, we just put a file in the public folder called about.html and just type in there Foo. Then visit https://recipes.dev/about.html and you see something not that elegant, but it shows you how easy it is to bypass Laravel altogether. It's a good example of making an error message or site is down for maintenance message.
  2. The next one is a bit more common. We will make a route that will just return Foo to the page.
  3. Then, finally, we use a real View placing the file here: resources/views/about.blade.php ...

Get Laravel 5.x Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.