Search⌘ K
AI Features

Manage the Tables

Explore how to implement CRUD operations and manage state transitions for restaurant tables using Laravel. This lesson guides you through creating API endpoints, defining unique validations, using state management packages, and authenticating with Bearer tokens. You'll learn to handle available, occupied, reserved, and non-operational states while testing with Postman to ensure robust functionality.

Time to go on your own

We know you are eager to jump in and start coding new modules yourself, and the time has come. The CRUD of tables is similar to that of menu items. Please take the following steps to add the API endpoints that allow users to add, update, and archive tables.

  1. Migration columns: id, restaurant_id (Foreign key), number (1, 2, 3, etc.), extra_details (optional), timestamps, deleted_at
  2. Eloquent model (with the SoftDeletes trait)
  3. Controller
  4. Form request (the table number should be unique for that restaurant)
  5. API resource class
  6. Factory
  7. Tests

Postman

The screenshots for all the table API endpoints: