14. Your First Complete, Controller- and View-Powered Page
In the previous lesson, you:
- learned why using a web application framework is so helpful
- created the start of your full Laravel web application
- learned about routes and how they direct traffic in a Laravel web app
What you'll learn and do in this lesson:
- create your first Laravel controller for static pages
- learn all about classes and how they work in PHP
- create a full About page, powered by a route, your controller, and a new view
.
.
.
.
.
The lesson:
.
.
.
.
.
What you should do now:
Do these Exercises:
- Add a Contact Page to Your Laravel Application
- Commit your changes to your Git repository and push them up to GitHub
- Write an entry in your Journal for this lesson
Read through these Resources:
.
.
.
.
.
Terms covered in this lesson:
- Skeeter
- guy whose shirt I'm reppin' in this lesson's video
- class
- a reusable, self-contained module of code, used for a specific purpose
- class instance
- if you think of the class as sort of a “template”, you can create an “object” based on that template; that “object” is called a class instance
- extend
- the ability of a class to "borrow" another class's functionality, using the
extends
keyword in PHP - controller action
- function in a controller whose explicit task is to handle a user request
Did you like this lesson? This is just the tip of the iceberg. Join From Idea To Launch now and you'll get...
- Access to all of the course lessons, which walk you through building a full Laravel app, step by step
- Your own login to save and track your progress
- Access to the private Slack community, where you can get all the help you need, from Alex, the course creator, and other course members
Your Course Compass
Module 1Your Idea
-
1. Coming Up With Web Application Ideas
- come up with a web application idea
- make sure that the idea you pick will work well for building an application
- and then break down that idea into its core components
-
2. Picking & Breaking Down Your Web Application Idea
- pick a single web application idea
- make sure that your idea will work as a web application
- break that idea into its core components
Module 2Your Setup
-
3. Getting to Know the Command Line
- get set up with your first main development tool, the command line
- go over all the basic commands you need to know
-
4. Getting to Know Your Source Code Editor, Sublime Text
- get set up with your second main development tool, the source code editor
- create the first, basic page of your new application
-
5. The Basics of Git & GitHub
- get Git setup and configured
- create a new Git repository on your own computer
- create a GitHub account and create a repository up there
- learn how to connect those two repositories and push updates up to GitHub
-
6. How Web Applications Work, From a High Level
- learn what "more advanced programming" entails
- learn how web applications function, from a high level
- understand, and be able to identify, how/when web applications fulfill requests
-
7. Setting Up Your Full Development Environment
- learn what software you'll be installing to set up your development environment
- install and configure your full development environment
- configure a custom URL to use with your web application
NOTE: If you have any troubles with your Homestead VM, make sure you check out the Troubleshooting Your Laravel Homestead Virtual Machine Resource sheet, including at the bottom of this lesson.
Module 3Your Basic Web Application
-
8. Creating Dynamic Pages With PHP
- learn to use PHP to separate structure and information
- use PHP to create a reusable page template
- learn how to extract information from a URL and create your first truly "dynamic" page
-
9. How Objects Flow In a Web Application (+ Connecting To Your VM's Database)
- learn how objects flow in a web application when a request is made
- understand how databases function, at a high level
- install phpMyAdmin to connection to your virtual machine's databases
-
10. Storing Your Objects' Info. In a MySQL Database
- create a new database, using phpMyAdmin, to store your application's objects
- learn how database tables are structured
- design and create your objects database table
- learn how to interact with your database using queries
-
11. Database-Powering Your Object Page
- connect to your database from your PHP page
- alter the page to retrieve the objects’ information from your database
- update your Git repository
-
12. The Core of All Web Applications
- review the flow of a request in a web app
- separate your front end and back end code
- learn how controllers and views fit into a web application
- learn about frameworks
Module 4Your Full Web Application
-
13. The Start of Your Full Laravel Web App
- learn why using a web application framework is so helpful
- create the start of your full Laravel web application
- learn about routes and how they direct traffic in a Laravel web app
-
14. Your First Complete, Controller- and View-Powered Page
- create your first Laravel controller for static pages
- learn all about classes and how they work in PHP
- create a full About page, powered by a route, your controller, and a new view
-
15. Laravel Configuration & Database Migrations
- create a new Git repository for your Laravel app
- learn how to configure your Laravel environment
- connect your app to the
homestead
database - learn how to use Laravel database migrations to manage your database
- use a migration to create your [objects] table
-
16. Migrating Your Dynamic Object Page
- learn about CRUD and Laravel resources
- create your first resource controller for your main object type
- create a dynamic route to be used for your new dynamic show object page
- learn how to pass data from a controller to a view
-
17. Creating Your First Model To Get Your Objects' Info.
- create your first Model — for your main object type
- use that model in the
show
action your controller to retrieve your object's information - finish implementing your fully dynamic, MVC-powered show object page!
-
18. Review: All the Core Pieces Are In Place
- review the flow of a complete request in a full MVC web app
- emphasize that you've already programmed the core of any web application
- talk about what's next!
-
19. Creating Wireframes To Design Your Core [Object]'s Pages
- discuss the purpose of creating wireframes to design your application's pages
- draw wireframes for your own application's core [object] pages
-
20. Standardizing Your Pages With a Layout
- create a universal page template to standardize the layout of your application's pages
- convert your views to use the new layout, or template
- create the start of your app's header and footer
-
21. Making the App Pretty Using Bootstrap
- install the Bootstrap framework to give your app a much-needed makeover
- make your app appear nicely on all devices with responsive design
- add a real header and footer
- learn how to keep your views nice and organized using partial views
-
22. Displaying Multiple Objects On One Page
- translate your wireframes into a real page
- implement a new page to display multiple [objects]
-
23. Adding a Page to Create New Objects
- implement a new create page route, action, and view
- install the Forms & HTML library for creating forms and their elements
- create the form using the Forms & HTML library functions and Bootstrap styles
- learn how to retrieve form submission data
-
24. Handling Form Submissions & Validating Object Creations
- use your [Object] model to create new objects in the database
- install the Esensi Models package and use it to set up model validation in your [Object] model
- handle success and failure scenarios when attempting to create new objects
-
25. Editing Existing Objects
- learn about the HTTP PUT method
- move the object form into a partial view and configure both the create and edit pages to load it
- implement a full edit page for editing existing objects
-
26. Deleting Existing Objects
- learn about the HTTP DELETE request method
- add a delete button to the bottom of the edit page
- create new delete route
- implement a controller action to delete objects from the database
-
27. Review: All the CRUD
- review the fact that you've now implemented all the aspects of CRUD in your application!
- learn about what's coming up after this
-
28. Adding Another Object Type and Object Relationships
- design a database table for the new object type
- learn how to establish relationships between database tables using foreign keys
- create the new object type's database table and model
- establish a relationship between your two models
- use that relationship to retrieve one object's related objects
-
29. CRUD For an Object With a Relationship (Part 1)
- draw wireframes for your new object's interface displays
- learn how to nest resources
- add a single route definition to establish all of the CRUD routes for a resource
- finalize the code to display the nested resource objects
-
30. CRUD For an Object With a Relationship (Part 2)
- implement the controller & view to create objects (of this second object type)
- implement the controller & view to edit objects (of this second object type)
- implement the controller & view to delete objects (of this second object type)
-
31. Adding a Category and Many-To-Many Relationships
- add support for a Category in your database
- establish the relationships between the Category and Objects
- implement the ability to specify Categories when creating or editing Objects
-
32. Displaying a Category's Objects
- implement admin CRUD pages for your new Category
- add a page to display your Categories and their associated Objects
- implement a way to access those new Category pages
-
33. Searching For Objects
- design & add a search form
- create a new search route and controller action to handle search submissions via the new form
- add a new page to display the search results
-
34. Registering New Users
- check out Laravel's built-in User functionality
- create a User Registration page
- use built-in actions to create new user via the Registration page
- alter your application's homepage
-
35. Adding User Authentication
- add a new Login page for users to sign in
- add user action links to the header to allow users to view their authentication status, and sign in and out
- learn how to add a custom attribute to a model
-
36. Add User Password Resets
- configure your app to send emails
- add user password reset functionality
-
37. Restricting User Access & Adding a Basic Profile Page
- establish connections between users and objects in the database
- establish those connections in the models
- change the retrieval of objects so only the active user's objects are shown in their index page
- associate newly-created objects with the active user
- restrict the user to editing their own objects
-
38. Adding User Roles & Admin Users
- add user roles
- add the ability to create admin users & check if the active user is an admin
-
39. Creating an Admin Interface – Part 1
- create an admin-only section of your app
- move certain pages to a new admin section
- restrict access to the admin section only to admin users
-
40. Creating an Admin Interface – Part 2
- create a set of admin pages for managing users
- migrate other administrative pages to the admin-only section of your app
- create a new layout for the admin-only section
Module 5Your Launch
-
41. Application Environments, Preparing for Deployment
- learn how application environments will be used in deploying your app
-
42. Deploying Your Application To The World!
- learn the fundamentals of deploying an application
- sign up for Digital Ocean to host your app's server
- sign up for Laravel Forge to deploy your application
- deploy the app via Laravel Forge!
-
43. Using a Custom Domain Name
- register a custom domain name
- associate that domain name with your deployed application