Add an About Page to Your Basic Web Application

This is a free resource from my online course, From Idea To Launch, where I teach you how to build a full Laravel web application, step by step, at beginner's speed. Learn more →

Right now your basic application contains two pages: the show object page, and the (placeholder) create object page.

Because, of course, your application will ultimately have many more pages! So it’s good to practice adding new pages early on on in the practice.

Like… right now :)

Add an About Page

This exercise will help you add a new About page to your basic application.

There are two steps required:

  1. To create a new Page controller
  2. And to create a new view for the About page

1. Create a new page controller

Remember, each controller is responsible for handling the pages of a single type.

This About page is a static page — it isn’t a page related to your current [object] pages. So, because of that, you need to start by creating a new controller.

Here’s your first task:

Create a new page-controller.php controller file, with an about function that loads up a page-about-view.php view file (that you’ll create in just a second).

You don’t need to worry about the database connection — because this page doesn’t require any info. from the database — but you do need to retrieve some info. from the URL…

Next up, create your view.

2. Create an About page view

You can take it from here. You just need to create a new About page view with some simple HTML. (You can just use some placeholder text.)

Just make sure you use the same file name you specified in your controller!

And, trust me, this practice will pay off, as you’ll be creating many more controllers and views as you continue to move through the course :)