Reference

Documentation

The full reference for TableFlow's modules, AI system, roles, database, and API — everything beyond the quick-start guide.

Overview

TableFlow is a full-stack restaurant management platform built on Laravel 12 and PHP 8.2. It covers everything from the kitchen pass to the customer's table, with an optional AI layer powered by the Anthropic Claude API, and a versioned REST API ready for a companion Flutter mobile app.

Three interfaces ship in one codebase:

Feature List

ModuleWhat it covers
Menu & CatalogCategories, items, size variants, add-ons, availability toggles
OrdersDine-in, takeaway, delivery — full pending → completed lifecycle
Kitchen DisplayLive kanban board grouped by order status
Tables & QRTable management with auto-generated QR ordering links
ReservationsGuest bookings with table assignment and status flow
CustomersProfiles, loyalty points, total spend, visit history
InventoryStock items, in/out movements, reorder alerts
StaffRole-based accounts, attendance check-in/out
CouponsFixed or percentage discounts with usage limits and expiry
ReviewsStar ratings with AI sentiment tagging
ReportsSales dashboards, date-range filters, Excel export
InvoicesOne-click PDF invoice generation per order

AI Features

All AI features are powered by a single service that wraps the Anthropic Claude Messages API. Each feature checks its own toggle before making a request, so disabling one never affects the others.

FeatureWhere it appearsWhat it does
Menu Description WriterAdmin → Menu ItemsGenerates appetizing marketing copy from a dish name and category
Upsell Recommendation EngineOrder creation, checkoutSuggests complementary items based on what's already in the order
Ordering Assistant (Chatbot)QR ordering page, Flutter appConversational help picking dishes and answering menu questions
Sales ForecastingAdmin DashboardPlain-language forecast and recommendations from recent sales data
Demand PredictionAdmin → Reports → AI Demand InsightsPredicts which items trend up/down over the next 7 days
Review Sentiment AnalysisAdmin → ReviewsAuto-tags each review positive/negative/neutral with a one-line summary

Master Toggle

Admin → Settings → AI Features has one master switch and six individual feature switches. Turning the master switch off disables every AI feature instantly — across the admin panel, the guest ordering page, and the API — regardless of the individual toggle states. This is useful for pausing AI spend entirely without touching any code.

AI-gated API endpoints return HTTP 422 with {"success": false, "message": "..."} when disabled. Handle this gracefully in client apps by hiding the related UI rather than treating it as a hard error.

User Roles

RoleTypical access
adminEverything, including Settings and AI configuration
managerOperations, staff management, reports (no system settings)
chefKitchen Display System and order status updates
waiterOrder taking, table status, reservations
cashierPayments, invoices, order status
deliveryDelivery order status updates

Role checks are enforced with a role middleware on route groups — e.g. Staff Management and Settings are restricted to admin/manager only.

Project Structure

app/
  Http/Controllers/
    Admin/    → Web dashboard controllers (staff-facing)
    Api/      → REST API controllers (Flutter app-facing)
    Public/   → QR ordering page + chatbot widget
  Models/     → Eloquent models, one per table
  Services/
    AIService.php  → All Claude API calls, one method per feature
database/
  migrations/ → All table definitions
  seeders/    → Admin user, settings, AI toggles, sample data
resources/views/
  layouts/app.blade.php  → Admin panel shell
  admin/      → All admin panel pages
  public/     → Guest QR ordering page
routes/
  web.php     → Admin panel + guest QR routes
  api.php     → Flutter app REST API (versioned /v1)

Database Schema Summary

Key tables and how they relate:

API Reference

Base URL: https://yourdomain.com/api/v1

MethodEndpointDescription
POST/auth/registerRegister a customer
POST/auth/loginLogin → returns Sanctum token
GET/menu/categoriesList active categories
GET/menu/itemsList available menu items
POST/chatbot/replyAI ordering assistant reply
GET/orders 🔒List my orders
POST/orders 🔒Place an order
GET/reservations 🔒My reservations
POST/reservations 🔒Create a reservation
POST/reviews 🔒Submit a review (auto-analyzed for sentiment)

🔒 = requires Authorization: Bearer <token>

# Example: place an order
POST /api/v1/orders
Authorization: Bearer 1|abcxyz...
Content-Type: application/json

{
  "type": "delivery",
  "items": [{ "menu_item_id": 4, "quantity": 2 }]
}

# Response
{ "success": true, "data": { "order_number": "ORD-260707-X1", ... } }

Branding & Colors

Restaurant name, phone, address, currency symbol, and tax rate are all editable from Admin → Settings → General — no code changes needed.

The admin panel's color palette is defined as CSS variables at the top of resources/views/layouts/app.blade.php:

:root {
  --brand: #ff5a1f;
  --brand-dark: #e14a12;
  --sidebar-bg: #16181d;
}

Change these three values to re-theme the entire dashboard consistently.

New to the project? Start with the Setup Guide → for step-by-step installation.