Introduction

Foodlay is a modern single-vendor restaurant management system built on top of the foodlay stack, combining a robust Laravel 12 backend with a dynamic Vue 3 frontend via Inertia.js.

  • Backend: Laravel 12
  • Frontend: Vue 3 (Composition API) with Inertia.js
  • Styling: Tailwind CSS 4
  • Build tool: Vite 7
  • Database: MySQL 8+/MariaDB 10.5+

System Architecture

  • Monolithic Laravel application with two decoupled frontend modules:
  • Admin Panel: dashboard for managing orders, items, users, and settings
  • Storefront: customer-facing web app for browsing menus and placing orders

Folder Structure

/app
/Http
  /Controllers
    /Api          (REST API V1)
    /Payment      (Gateways: Stripe, PayPal, etc.)
    /Web          (Inertia controllers: Admin, StoreFront)
  /Middleware
  /Requests
  /Resources
/config
/database
/public          (POINT DOMAIN HERE)
/resources
  /js
    /AdminPanel   (Admin Vue app)
    /StoreFront   (Customer Vue app)
    /components   (Shared UI)
    /lib          (Utilities)
  /css            (Tailwind entries)
  /views          (Blade entry points)
/routes
  /api            (Versioned API routes)
  /web            (Admin, Storefront, Installer)
/storage
.env

System Features

Dashboard & Analytics

  • Real-time overview of orders, revenue, and active users
  • Reports: sales & revenue, category & item performance, user activity, hourly trends

Order Management

  • Full lifecycle tracking: Pending, Confirm, Processing, Handover, Picked Up, Delivered
  • Delivery assignment (manual/automatic), invoice generation, refund workflows

Food & Menu Management

  • Advanced item setup (description, images, pricing)
  • Variations & addons; categories & sub-categories; labels & cuisines
  • Bulk import/export via CSV/Excel

Marketing & Promotions

  • Coupons with limits/expiry; BOGO; Happy Hour scheduling
  • Loyalty points redeemable to wallet; push notifications via Firebase
  • Sales popups for FOMO on storefront

User Management

  • Employee roles & granular permissions
  • Deliveryman management with shift tracking and earnings
  • Customer wallet and CRM (orders, points, balance)

Website & Content

  • Page builder for About/Privacy/Terms
  • Blogs and FAQ modules
  • Social links configuration

Settings & Configuration

  • Payment gateways: Stripe, PayPal, Razorpay, Flutterwave
  • SMS gateways: Twilio, Nexmo
  • Firebase setup for notifications/auth; Mail via SMTP (Gmail, SES, Mailgun)
  • Business info: currency, time zone, logo, branding

Communication

  • Live chat between customers and Admin/Support
  • Order-specific support channels

System Maintenance

  • Database backups, system health view (PHP version, extensions)
  • Activity logs for auditing

Security

  • Role-based access control
  • Secure login protections

Prerequisites

Server Requirements

  • PHP ≥ 8.2
  • Composer ≥ 2.5
  • Node.js ≥ 18.x
  • MySQL 8.0+ or MariaDB 10.5+

PHP Extensions

BCMath
Ctype
Fileinfo
JSON
Mbstring
OpenSSL
PDO (pdo_mysql)
Tokenizer
XML
curl
gd
exif
intl
zip
Server requirements check

Quick Start Guide

Pre-flight Checklist

  • Domain and hosting meeting prerequisites.
  • Purchase code available.
  • Empty MySQL/MariaDB database created.

4-Step Installation

  • Upload and unzip install.zip.
  • Point domain document root to /public.
  • Run installer wizard in browser.
  • Configure DB credentials and purchase code.

Post-Installation

  • Configure business settings.
  • Set up mail (SMTP).
  • Configure cron job.
  • Create zone and add first food item.
Business setup screen

Installation Process

Database Creation

  • Step A: Create database via cPanel wizard.
  • Step B: Create DB user and password.
  • Step C: Assign ALL PRIVILEGES to the user.
Database setup wizard

Extraction & Setup

Note: The vendor folder and public/build folder are not included in the package. You must generate them yourself after extraction by running the commands below.
  • Upload and unzip install.zip to server root.
  • Point domain/subdomain to /public.
  • Ensure writable: /storage, /bootstrap/cache, .env.
  • Run composer install to install PHP dependencies.
  • Run npm install then npm run build to compile frontend assets.

Automated Wizard

  • Visit site to start installer.
  • Enter DB credentials and purchase code.
  • Finish and log in to Admin Panel.
Purchase verification Finalize installation Installation success

Basic Configuration

Core

  • Business details, currency, time zone, branding.
  • Enable/disable modules as needed.

Integrations

  • Payment gateways: Stripe, PayPal, Razorpay, Flutterwave, etc.
  • SMS gateways: Twilio, Nexmo, others for OTP.
  • Firebase: push notifications and auth.
  • Mail: SMTP (Gmail, AWS SES, Mailgun).

Environment

.env contains sensitive credentials. Do not commit it. Ensure APP_URL matches your domain.
APP_NAME=
APP_ENV=
APP_KEY=
APP_URL=
DB_HOST=
DB_PORT=
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
MAIL_MAILER=
QUEUE_CONNECTION=
BROADCAST_DRIVER=
CACHE_DRIVER=

Server Configuration

Local Development

  • php artisan serve (local dev only)
  • Access: http://127.0.0.1:8000

Production .env Essentials

  • Disable debug in production and set a correct APP_URL.
APP_ENV=production
APP_DEBUG=false
APP_URL=https://example.com
LOG_CHANNEL=stack
CACHE_DRIVER=file
QUEUE_CONNECTION=database
SESSION_DRIVER=file
SESSION_SECURE_COOKIE=true
# If using subdomains:
SESSION_DOMAIN=.example.com
# If behind a proxy/CDN:
TRUSTED_PROXIES=*

Nginx

server {
    listen 80;
    server_name example.com;
    root /var/www/foodlay/public;
    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";
    index index.php;
    charset utf-8;
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

Nginx (HTTPS + Redirect)

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://example.com$request_uri;
}
server {
    listen 443 ssl http2;
    server_name example.com;
    root /var/www/foodlay/public;
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";
    index index.php;
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
    location ~ \.php$ {
        # Adjust socket or use 127.0.0.1:9000 depending on your PHP-FPM setup
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }
    location ~* \.(?:css|js|jpg|jpeg|gif|png|webp|ico|svg)$ {
        expires 7d;
        add_header Cache-Control "public, max-age=604800, immutable";
    }
}

Apache

<VirtualHost *:80>
    ServerName example.com
    DocumentRoot /var/www/foodlay/public
    <Directory /var/www/foodlay/public>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Apache (HTTPS + Redirect)

<VirtualHost *:80>
  ServerName example.com
  Redirect permanent / https://example.com/
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
  ServerName example.com
  DocumentRoot /var/www/foodlay/public
  SSLEngine on
  SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
  <Directory /var/www/foodlay/public>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>
</IfModule>

LiteSpeed / OpenLiteSpeed

  • Enterprise: point document root to /public; uses .htaccess
  • OpenLiteSpeed: enable Rewrite and auto-load .htaccess in Virtual Host

SSL & Security

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com

Subdomains for Admin & Storefront

  • Point both example.com (storefront) and admin.example.com (Admin Panel) to the same /public.
  • Ensure APP_URL matches the primary domain; use SESSION_DOMAIN=.example.com when sharing sessions across subdomains.
  • If using a CDN/proxy (e.g., Cloudflare), set TRUSTED_PROXIES=* and keep APP_URL on https.

cPanel Alternative (if /public not possible)

  • Upload project to /public_html/foodlay_core/
  • Move all files from /foodlay_core/public/ to /public_html/
  • Edit public_html/index.php paths:
require __DIR__.'/foodlay_core/vendor/autoload.php';
$app = require_once __DIR__.'/foodlay_core/bootstrap/app.php';

Permissions

  • Ensure writable: /storage, /bootstrap/cache, .env
sudo chown -R www-data:www-data /var/www/foodlay
find /var/www/foodlay -type f -exec chmod 644 {} \;
find /var/www/foodlay -type d -exec chmod 755 {} \;

Cron Job

* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1

Queue Workers

  • Use Supervisor/systemd when QUEUE_CONNECTION=database
# /etc/supervisor/conf.d/foodlay-worker.conf
[program:foodlay-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/foodlay/artisan queue:work --sleep=1 --tries=3 --max-time=3600
autostart=true
autorestart=true
numprocs=2
redirect_stderr=true
stdout_logfile=/var/log/supervisor/foodlay-worker.log

CORS (API on another domain)

  • If the mobile apps call this API from a different domain, configure config/cors.php accordingly.
'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_origins' => ['https://app.example.com', 'https://admin.example.com'],
'allowed_methods' => ['*'],
'allowed_headers' => ['*'],
'supports_credentials' => true,

Deployment

First-Time Deployment

  • Point domain/subdomain document root to /public
  • Upload project files to server
  • Ensure writable: /storage, /bootstrap/cache, .env
  • Create database and user, grant privileges
  • Install PHP dependencies with production flags
  • Generate APP_KEY and link storage
  • Install Node dependencies and build assets
  • Run migrations (and seeders if needed)
  • Cache configuration and routes
composer install --no-dev --optimize-autoloader
php artisan key:generate
php artisan storage:link
npm ci
npm run build
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache

Post‑Deployment Checklist

  • Visit / to ensure pages load and assets resolve
  • Check APP_URL correctness and HTTPS redirects
  • Verify public/build is present and Vite manifest loads
  • Run health checks: DB connection, cache, queue
  • Confirm storage symlink works (image uploads)

Backups & Rollback

  • Backup database and .env before upgrades
  • Keep previous release for quick rollback
  • Restore DB from dump if migrations fail and rollback is required

cPanel Shared Hosting

  • If document root cannot point to /public, move public files to public_html and adjust index.php paths
  • Run composer install --no-dev --optimize-autoloader via SSH or cPanel terminal
  • Run npm install and npm run build locally, then upload the generated public/build folder to the server

Update Procedure

Foodlay includes a built-in updater that allows administrators to apply new versions directly from the Admin Panel. Follow the steps below to safely update your Admin Panel and Web Storefront.

Before You Update

Always back up your database and files before applying an update. Updates may include database migrations that alter existing tables.
  • Create a full database backup via phpMyAdmin, cPanel, or CLI
  • Back up your .env file and any custom modifications
  • Ensure your server meets the latest version's requirements
  • Download the update.zip file from your purchase account

Step-by-Step Update Process

  • Step 1: Log in to the Admin Panel using your administrator credentials.
  • Step 2: Navigate to the updater page by visiting yourdomain.com/updater in your browser.
  • Step 3: On the updater page, click the file upload area and select the update.zip file you downloaded.
  • Step 4: Click the Update button to begin the update process.
  • Step 5: Wait for the process to complete. The system will extract the files, apply database migrations, and clear caches automatically.

Post-Update Checklist

  • Verify the application loads correctly and check for any errors
  • Confirm the version number has been updated in the Admin Panel
  • Test core functionality: placing an order, processing payments, and login flows
  • Clear browser cache to ensure updated assets are loaded

Update Troubleshooting

  • Upload fails or times out: Increase PHP upload_max_filesize and post_max_size to at least 64M in your php.ini
  • Permission denied errors: Ensure /storage, /bootstrap/cache, and project root are writable by the web server
  • 500 error after update: Run the following commands via SSH to clear all caches:
php artisan optimize:clear
php artisan config:clear
php artisan cache:clear
  • Rollback: If the update causes critical issues, restore your database backup and replace the application files with your pre-update backup

Troubleshooting

500 Server Error

  • Check storage/logs/laravel.log
  • Fix permissions:
chmod -R 775 storage
chmod -R 775 bootstrap/cache

Vite manifest not found

  • Ensure public/build exists and was uploaded correctly

Images not loading

  • Link storage:
php artisan storage:link

404 Not Found (except homepage)

  • Nginx: include try_files $uri $uri/ /index.php?$query_string;
  • Apache: ensure .htaccess exists and mod_rewrite is enabled

Emails not sending

  • Verify SMTP config; test connection
  • Use QUEUE_CONNECTION=sync for testing or run workers

Class/Target not found

composer dump-autoload
php artisan optimize:clear

Changes not reflecting

php artisan optimize:clear
php artisan config:clear
php artisan cache:clear

419 Page Expired (CSRF)

  • Check SESSION_DOMAIN; ensure sessions path is writable; set SESSION_SECURE_COOKIE when HTTPS

Mixed Content (HTTP/HTTPS)

APP_URL=https://yourdomain.com

Composer platform issues

composer install --ignore-platform-reqs

SQL strict mode errors

  • Set 'strict' => false in config/database.php and clear config cache

Large file uploads fail

upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 512M

Node/Vue build issues

rm -rf node_modules package-lock.json
npm install --legacy-peer-deps
export NODE_OPTIONS=--max_old_space_size=4096
npm run build

Customization

Controllers & Services

  • Controllers in app/Http/Controllers handle requests
  • Services in app/Services encapsulate business logic

Models

  • Use migrations for schema changes; update model $fillable
php artisan make:migration add_column_to_items_table

Frontend (Vue 3 + Inertia)

  • Pages in resources/js/Pages
  • Components in resources/js/Components
  • Run npm run dev for HMR; npm run build for production

Styling & Themes

  • Tailwind CSS entries in resources/css
  • Rebuild assets after changes

Translations

  • Manage languages via Admin Panel; developer seeds in database/seeders

Email Templates

  • Blade templates at resources/views/emails

Routes

Route::get('/', fn () => Inertia::render('StoreFront/Home'));
Route::get('/admin', fn () => Inertia::render('AdminPanel/Dashboard'));
Included: feature questions, bug assistance, help with bundled assets
Not included: customization services, installation, hosting/server issues

Before Contacting

Version History

Version 2.0 — April 2026

This is a major update. Back up your database and files before upgrading.
  • Upgraded backend to Laravel 12 with full PHP 8.2+ support
  • Migrated frontend to Vue 3.5 + Inertia.js 2.0 with Composition API
  • Upgraded build tooling to Vite 7 and Tailwind CSS 4
  • Added Happy Hour scheduling with time-based discount rules
  • Added BOGO (Buy One Get One) offer support
  • Added Invoice Setup — customizable invoice templates per business
  • Added Refund Management — admin refund request handling with status tracking
  • Added Tax Management — flexible tax rules per item and category
  • Added Real-time Chat between Admin, Customers, and Delivery staff via Laravel Reverb (WebSockets)
  • Added Two-Factor Authentication (TOTP) for admin accounts
  • Added Loyalty Points system — earn and redeem points via wallet
  • Added Wallet — customer wallet with top-up and transaction history
  • Added Referral System — referral codes with configurable rewards
  • Added Blog Module — full blog management with categories and rich-text editor
  • Added Newsletter subscription management
  • Added AWS S3 integration for cloud media storage
  • Added Google reCAPTCHA v3 on login and registration
  • Improved Admin Panel UI with shadcn-vue component library
  • Improved Storefront with enhanced product and category browsing
  • Performance improvements via optional Laravel Octane (Swoole) support
  • Built-in one-click updater at yourdomain.com/updater

Version 1.0 — 07 March 2026

  • Initial release
  • Laravel 11 backend with Vue 3 + Inertia.js frontend
  • Full order lifecycle management (Pending → Delivered)
  • Category, food item, and addon management
  • Delivery assignment and zone management
  • Payment gateway integration (Stripe)
  • Firebase push notifications
  • Multi-language support (EN, BN, HI, AR, ES)
  • Customer-facing web storefront
  • Admin panel with dashboard and analytics
  • Role-based employee access control
  • Coupon and discount management
  • Customer and deliveryman management
  • SMTP email integration