This assignment will use Laravel and the chinook SQLite database.
All Laravel assignments, labs, and class demos will build on the same installation.
/ route so that it directs users to
/genres instead of
You are going to create middleware that redirects users to a maintenance mode page that comes default with Laravel if you visit the URL
/maintenance, if there is a record in the
settings table with an
maintenance_mode and its
value is 1. If that record’s
value is 0, users should not be redirected to that page. Name the middleware
MaintenanceMode. This middleware should only apply to public routes (the ones without the
protected middleware), but exclude the following:
This is so that certain users can login even if the site is in maintenance mode.
/settings page that is protected by authentication. This page will have a form with one checkbox that will toggle the
settings record with an
maintenance_mode. You can use Eloquent or the Query Builder for this.
Add a navigation link for this page, and make sure it only shows up if the user is logged in.
Please push up your code including the database to GitHub to the same repository as last week (itp405-laravel-assignments). You should already have connected your GitHub repository to Heroku for automatic deployments. If you haven’t, follow these instructions. Verify that your app has been deployed and it works on Heroku. Send an email to me and the TA with the repository URL and the URL to the live site on Heroku.