Search⌘ K

Laying the Foundation

Explore how to lay the foundation for a restaurant management API in Laravel. Learn to create database migrations, seed tables using CSV files, implement API calls to fetch countries and states, and write tests to ensure endpoint reliability.

Overview

With the authentication part done, we are ready to move to the heart of the course: restaurant management. Restaurants will have complete addresses, and we will store the country and the state for each restaurant. In this lesson, we are preparing for the ‘Restaurant’ module.

For the ‘Country’ module, we will do the following:

  1. Migration + Eloquent model
  2. Seeder + CSV file with data
  3. The API call to fetch countries
  4. A test for the API call

Do it yourself stuff

The migration, the Eloquent model, and the API call are fairly easy to do. It will help if you try them yourself. Here are some notes:

...