I will cover how easy it is to add a static page. We will look at several approaches.
We have a base install from all the previous work done and an About link. We are going to make that work.
I will show three ways. This first way, we just put a file in the public folder called
about.html
and just type in thereFoo
. 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.The next one is a bit more common. We will make a route that will just return
Foo
to the page.Then, finally, we use a real View placing the file here:
resources/views/about.blade.php
.And then make the file look like the following:
Then update the route file to return this view, no need for a controller for this:
Then visit https://recipes.dev/about and you should see this (could use some serious copy help...