Question: Database Setup Assignment Objectives : Assure your database is setup correctly Get familiar with Laravel database configurations Get familiar with Eloquent Model Specifications: Generate New

Database Setup Assignment

Objectives:

  • Assure your database is setup correctly
  • Get familiar with Laravel database configurations
  • Get familiar with Eloquent Model

Specifications:

  • Generate New Laravel App (named: CityNameDbApp)
  • Configure it to use SQLite
  • Create a migration for a new table called cities
    • Add fields for cities (it should already have id and timestamps by default):
      • name (string)
      • state (string)
      • population_2010 (integer)
      • population_rank (integer)
  • Generate an Eloquent model file for City
  • Manually create 10 cities in your table via Tinker
  • Create a route (/cities) that loads cities from your database table
  • Create a blade view that iterates over the cities and displays them on a web page.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!