MarketPro / Documentation
πŸ“‹ v1.0 Β· Laravel 12

MarketPro Docs

Complete technical reference for installing, configuring, and extending MarketPro β€” the multi-vendor e-commerce platform built on Laravel 12 with 13 AI features.

πŸ“‹ Overview

MarketPro is a production-ready multi-vendor e-commerce platform on Laravel 12. It requires no Node.js, no npm, and no build step β€” all frontend assets load via CDN. One Artisan command installs everything.

πŸͺ
Multi-Vendor
Unlimited vendors with independent storefronts, dashboards, and payout tracking
✦
13 AI Features
Claude claude-sonnet-4-6 β€” all individually toggleable with graceful fallbacks
πŸ’±
20+ Currencies
Session-based switching with configurable exchange rates
🌍
Multi-Language + RTL
Add languages with free auto-translation, full RTL layout support
πŸ’³
6 Payment Gateways
Stripe, PayPal, Razorpay, Flutterwave, COD, Bank Transfer
πŸ”
4 User Roles
Admin, Sub-Admin (permission-based), Vendor, Customer β€” fully separated
πŸ“±
SMS Notifications
5 SMS providers configurable from the admin UI β€” no .env editing needed
πŸ“‚
public/uploads Storage
No symlinks needed β€” works on shared hosting, cPanel, Docker, anywhere

βš™οΈ Requirements

RequirementMinimumRecommended
PHP8.18.2 or 8.3
Laravel12.x (included)
DatabaseMySQL 5.7 / SQLite 3MySQL 8.0+
Composer2.xLatest
Node.js / npmNot required
PHP Extensionspdo, mbstring, openssl, tokenizer, xml, curl, gd, fileinfo, zip
Web ServerApache / NginxNginx + PHP-FPM
Memory Limit128MB256MB+ (for AI features)
βœ…
Shared Hosting Compatible. Point your domain root to the public/ folder. No symlinks required. Works on cPanel and Plesk without any special configuration.

πŸ“¦ Installation

1
Install PHP dependencies
Run Composer in the project root to install Laravel, Spatie, DomPDF, Socialite, and all packages.
composer install
2
Create environment file and app key
cp .env.example .env
php artisan key:generate
3
Configure database in .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=marketpro
DB_USERNAME=root
DB_PASSWORD=your_password
4
Run the one-step installer
Creates upload dirs, runs migrations, seeds demo data, creates language file, clears all caches.
php artisan marketpro:install

# Flags:
# --fresh     Drop all tables and reinstall from scratch
# --no-seed   Migrate only, skip demo data seeding
5
Start development server
php artisan serve
# Open: http://127.0.0.1:8000
πŸ’‘
Production: After deploying run php artisan config:cache && php artisan route:cache && php artisan view:cache. Ensure public/uploads/ is writable by the web server user.

πŸ“ File Structure

marketpro/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ Console/Commands/
β”‚   β”‚   β”œβ”€β”€ InstallCommand.php          # marketpro:install
β”‚   β”‚   └── MarketProCommands.php       # sync-uploads, create-admin, backup, clear-ai-cache
β”‚   β”œβ”€β”€ Helpers/
β”‚   β”‚   β”œβ”€β”€ functions.php              # setting(), currency_format(), ai_enabled(), theme_css()…
β”‚   β”‚   └── UploadHelper.php           # upload(), delete(), url() β†’ public/uploads/
β”‚   β”œβ”€β”€ Http/Controllers/
β”‚   β”‚   β”œβ”€β”€ Admin/                      # AdminControllers, MoreAdminControllers, AiControllers…
β”‚   β”‚   β”œβ”€β”€ Vendor/VendorControllers.php
β”‚   β”‚   β”œβ”€β”€ Customer/                   # CartController, CheckoutController, CustomerControllers
β”‚   β”‚   β”œβ”€β”€ SubAdmin/DashboardController.php
β”‚   β”‚   β”œβ”€β”€ Api/AiChatController.php
β”‚   β”‚   └── Auth/AuthController.php
β”‚   β”œβ”€β”€ Http/Middleware/
β”‚   β”‚   β”œβ”€β”€ SetLocale.php              # Resolves locale: session β†’ user pref β†’ site default
β”‚   β”‚   β”œβ”€β”€ ShareViewData.php          # Injects cartCount into all views
β”‚   β”‚   └── VendorApproved.php         # Blocks suspended/unapproved vendors every request
β”‚   β”œβ”€β”€ Models/
β”‚   β”‚   β”œβ”€β”€ Models.php                 # All 30+ Eloquent models
β”‚   β”‚   β”œβ”€β”€ AiSetting.php              # canUse(), hasApiKey(), getApiKey()
β”‚   β”‚   └── Currency.php               # 20+ currencies, session-based conversion
β”‚   └── Services/
β”‚       β”œβ”€β”€ AiService.php              # 13 AI methods, all with graceful fallbacks
β”‚       β”œβ”€β”€ OrderService.php           # createOrder(), updateStatus(), updatePaymentStatus()
β”‚       β”œβ”€β”€ SmsService.php             # 5 SMS gateway integrations
β”‚       └── NotificationService.php    # In-app + email notifications
β”œβ”€β”€ database/
β”‚   β”œβ”€β”€ migrations/                     # All tables in 2 migration files
β”‚   └── seeders/DatabaseSeeder.php      # Demo admin, vendor, customer + all default settings
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ uploads/                        # Created by installer β€” 11 subdirectories
β”‚   └── images/payments/                # SVG payment logos
β”œβ”€β”€ resources/views/                    # 103 Blade views across 8 sections
β”‚   β”œβ”€β”€ layouts/                        # admin.blade.php, app.blade.php
β”‚   β”œβ”€β”€ admin/                          # 49 views
β”‚   β”œβ”€β”€ vendor/                         # 10 views
β”‚   β”œβ”€β”€ customer/                       # 25 views
β”‚   β”œβ”€β”€ subadmin/                       # 4 views
β”‚   β”œβ”€β”€ emails/                         # invoice, order-confirmation, order-status-updated
β”‚   └── partials/                       # product-card, ai-chat-widget
└── routes/web.php                      # All routes, grouped by role with middleware

πŸ” User Roles

MarketPro uses Spatie Laravel-Permission. Four roles are seeded automatically.

RoleURL PrefixMiddlewareAccess
admin/adminrole:admin|sub-adminFull platform control
sub-admin/sub-adminrole:sub-adminPermission-restricted subset
vendor/vendorrole:vendor,vendorApprovedOwn store management
customer/my-accountauthProfile, orders, wishlist

Sub-Admin Permissions

12 granular permissions assignable per sub-admin from Admin β†’ Sub Admins β†’ Edit. The sidebar automatically shows only permitted sections:

manage_products    manage_orders      manage_customers
manage_vendors     manage_categories  manage_coupons
manage_banners     manage_reports     manage_shipping
manage_payments    manage_reviews     manage_settings

πŸ—„οΈ Database Models

ModelTableKey Relations / Methods
UserusershasOne Vendor; hasMany Orders, Addresses, Cart, Wishlist, Notifications
VendorvendorsbelongsTo User; hasMany Products, Orders, Withdrawals
ProductproductsbelongsTo Vendor, Category, Brand; hasMany Images, Variations, Reviews; current_price, discount_percent, effective_free_shipping, effective_return_days
OrderordersbelongsTo User, Vendor, parentOrder; hasMany Items, StatusHistory, childOrders; status_badge
OrderItemorder_itemsbelongsTo Order, Product, Vendor, Variation
CartcartsbelongsTo User, Product, ProductVariation
CouponcouponsisValid($subtotal), calculateDiscount($subtotal)
Settingsettingsget($key, $default), set($key, $value, $group), clearCache()
LanguagelanguagesscopeActive(), is_default, direction (ltr/rtl)
Currency(static class)getAll(), find($code), active(), convert($amount), symbol()
AiSettingai_settingscanUse($feature), hasApiKey(), getApiKey()

πŸ“¦ Order System

Single vs Multi-Vendor Orders

Single-vendor checkout creates exactly one order row with vendor_id set directly and parent_order_id = null. No child order is created.

Multi-vendor checkout creates a parent order (vendor_id = null) plus one child order per vendor (parent_order_id = parent.id). The parent holds all items for invoicing. The admin orders index filters to whereNull('parent_order_id').

Order Status Flow

pending β†’ confirmed β†’ processing β†’ shipped β†’ out_for_delivery β†’ delivered
                                                              β†˜ cancelled (from any state)

Each status change creates an OrderStatusHistory record. Customer is notified by email and SMS (if configured) on each transition.

Invoice Generation

Invoices are generated as PDFs using DomPDF. The view is resources/views/emails/invoice.blade.php. Prices display in base currency using base_currency_format() β€” not the customer's session currency β€” because invoices reflect the actual charged amount.

✦ AI Features Reference

All AI features use Claude claude-sonnet-4-6 via the Anthropic API. Each is gated by AiSetting::canUse($feature) which verifies: master switch ON + feature toggle ON + API key present.

πŸ’‘
Zero dependency on AI. Every AI feature has a graceful fallback. The platform runs identically without any Anthropic API key. Simply leave ANTHROPIC_API_KEY empty or turn off the master switch.
Feature KeyWhat it doesFallback when off
ai_chat_enabledCustomer support widget β€” knows store policies, customer's ordersStatic contact info
ai_recommendations_enabledPersonalised product recommendations from purchase historyTop sellers by count
ai_smart_search_enabledNLP search β€” parses natural language, extracts price/attribute filtersStandard LIKE search
ai_description_enabledGenerates product description, short desc, meta title, meta desc, tagsManual text fields
ai_seo_enabledSEO optimisation suggestions for existing productsManual fields
ai_forecast_enabled30-day revenue forecast from 90 days of historical order dataSimple 30-day average
ai_fraud_enabledFraud risk scoring per order: Low/Medium/High/Critical + reasoningAuto-approve all orders
ai_pricing_enabledSuggests optimal price based on category, competition, costManual pricing
ai_inventory_enabledRecommends reorder points and quantities per productManual threshold
ai_email_enabledPersonalised email content for order confirmationsStandard templates
ai_vendor_insights_enabledVendor performance narrative: strengths, risks, recommendationsRaw metrics display
ai_review_analysis_enabledSentiment analysis + summary across all product reviewsRaw review list
ai_translate_enabledEnhanced translation quality for language stringsFree Google Translate

Enabling AI

# .env β€” only these two lines needed
ANTHROPIC_API_KEY=sk-ant-api03-...
ANTHROPIC_MODEL=claude-sonnet-4-6   # optional, this is the default

Then go to Admin β†’ AI Features and toggle the master switch ON. Individual features can be toggled independently.

⚠️
API Cost Tip: The AI chat widget fires on every customer message. Enable only the features you actively need to manage API usage costs effectively.

πŸ’³ Payment Gateways

Configure all gateways from Admin β†’ Payments β†’ Payment Gateways. Credentials store in the database β€” no .env editing required after initial setup.

GatewayTypeRequired Config
StripeCard / WalletsPublishable Key, Secret Key, Webhook Secret
PayPalPayPal / CardClient ID, Client Secret, Mode (sandbox/live)
RazorpayCard / UPI / Net BankingKey ID, Key Secret
FlutterwaveCard / Mobile Money / BankPublic Key, Secret Key, Encryption Key
Cash on DeliveryOfflineNone required
Bank TransferOfflineBank account details (shown as instructions to customer)

🌍 Multi-Language

Language strings are stored as JSON files in resources/lang/{code}.json. The admin language manager (Admin β†’ Languages) allows adding, editing, auto-translating, and toggling languages.

Adding a Language

1
Go to Admin β†’ Languages β†’ Add Language
Enter name, 2-letter ISO code (e.g. fr), direction (LTR/RTL), and optionally a flag image.
2
Auto-Translate
Click "Auto-Translate" to translate all English strings automatically using the free Google Translate endpoint. No API key needed.
3
Review & Edit Strings
Click "Edit Strings" to review and manually override any translation. Strings are searchable.
4
Set as Default (optional)
Click "Set Default" to make this the site's default language for all new visitors.
βœ…
RTL Support: Set direction to RTL when adding Arabic, Hebrew, Urdu, etc. The entire layout flips automatically β€” all admin, vendor, and customer panels support RTL.

πŸ’± Multi-Currency

MarketPro ships with 20 pre-configured currencies. Prices are stored in your base currency. When a customer switches currency, prices are converted in real-time using session-stored exchange rates.

How it works

// Customer switches to EUR β†’ stored in session:
currency_code     = "EUR"
currency_symbol   = "€"
currency_rate     = 0.92    // multiplied against USD base price

// currency_format() applies the conversion automatically
currency_format(100.00)  // β†’ "€92.00"

// base_currency_format() always shows base currency (for invoices, admin)
base_currency_format(100.00)  // β†’ "$100.00"

Enable the frontend switcher in Admin β†’ Settings β†’ General β†’ Enable Multi-Currency Switcher. Customers then see a currency dropdown in the site header.

πŸ“ File Uploads

All uploads go to public/uploads/ with sub-directories per content type. This means no storage:link symlink is needed β€” files are directly accessible as public assets.

public/uploads/
β”œβ”€β”€ products/        # Product thumbnails and gallery images
β”œβ”€β”€ avatars/         # User profile photos
β”œβ”€β”€ vendors/         # Vendor logos and store banners
β”œβ”€β”€ categories/      # Category images
β”œβ”€β”€ branding/        # Site logo, favicon
β”œβ”€β”€ banners/         # Homepage banners
β”œβ”€β”€ flags/           # Language flag images
β”œβ”€β”€ reviews/         # Review photos
β”œβ”€β”€ brands/          # Brand logos
β”œβ”€β”€ pages/           # CMS page images
└── payments/        # Payment confirmation screenshots

The UploadHelper class handles all file operations. Use upload_url($path) in Blade to get the full URL with fallback to a placeholder image.

πŸ”§ Environment Variables

VariableRequiredDescription
APP_KEYYesGenerated by php artisan key:generate
DB_*YesDatabase connection credentials
ANTHROPIC_API_KEYAI onlyAnthropic API key for Claude AI features
ANTHROPIC_MODELOptionalDefault: claude-sonnet-4-6
MAIL_*EmailSMTP credentials for transactional email
GOOGLE_CLIENT_IDOptionalGoogle OAuth β€” for customer login with Google
GOOGLE_CLIENT_SECRETOptionalGoogle OAuth secret
GOOGLE_REDIRECT_URIOptionalDefault: /auth/google/callback
πŸ’‘
Payment gateway and SMS credentials are stored in the database, not in .env. Configure them after installation via Admin β†’ Payments and Admin β†’ SMS Gateways.

πŸ’» Artisan Commands

CommandDescription
marketpro:installFull install: create dirs, migrate, seed, create lang file, clear caches. Use --fresh to drop+reinstall, --no-seed to skip seeding.
marketpro:sync-uploadsRe-create any missing upload sub-directories in public/uploads/
marketpro:create-adminInteractive: create or update a super admin account by email
marketpro:clear-ai-cacheFlush all AI response caches. Add --reset-stats to also reset usage counters.
marketpro:backupMySQL dump to storage/backups/backup-YYYY-MM-DD-HHmmss.sql

🎨 Branding & Theme

Go to Admin β†’ Branding & Theme to customise the visual identity without touching code. All settings are applied via CSS custom properties injected by the theme_css() helper function in every layout.

SettingOptions
Primary Color8 presets + custom hex (#rrggbb)
Secondary ColorCustom hex
Accent ColorCustom hex
Font Family10 Google Fonts (Inter, Poppins, Roboto, etc.)
Border RadiusNone / Small / Medium / Large / XL / Full (pill)
LogoUpload PNG/SVG (max 2MB)
FaviconUpload ICO/PNG (max 512KB)

πŸ”© Helper Functions

FunctionReturnsDescription
setting($key, $default)mixedRead setting from DB with 1-hour cache. Falls back to $default if not found.
currency_format($amount)stringFormat and convert amount using active session currency. E.g. $84.99 or €78.19
base_currency_format($amount)stringFormat in base site currency only. Used for invoices, admin panels, stored prices.
ai_enabled($feature)boolReturns true only if master switch ON + feature toggle ON + API key set
ai_has_key()boolTrue if ANTHROPIC_API_KEY is configured and non-empty
upload_url($path, $placeholder)stringFull URL to an uploaded file, with optional placeholder image if path is null
app_name()stringSite name from settings, falls back to config app.name
app_logo()stringFull URL to site logo; falls back to /images/logo.png
primary_color()stringPrimary hex color from settings. Default: #6366f1
theme_css()stringCSS custom properties block β€” output directly in <style> tags in layout head
is_rtl()boolTrue if current locale language is RTL
generate_order_number()stringUnique order number with configurable prefix. E.g. ORD-A8F3D2

πŸ”‘ Demo Credentials

RoleEmailPasswordPanel URL
Super Adminadmin@marketpro.comAdmin@12345/admin
Vendorvendor@marketpro.comVendor@12345/vendor
Customercustomer@marketpro.comCustomer@12345/login

πŸ”¨ Troubleshooting

❌
Summernote "Cannot read properties of undefined"
jQuery must load before Bootstrap JS and Summernote. The admin layout injects jQuery in <head>. If you add custom scripts, always keep jQuery first.
❌
Currency symbol shows ?
Go to Admin β†’ Settings β†’ General and set your Currency Symbol (e.g. $). The system always falls back to $ if empty, but it's best to set it explicitly.
⚠️
Two order rows created
This is fixed in the current version. Single-vendor orders now create exactly one row. Run php artisan cache:clear if you see unexpected behaviour.
⚠️
Upload directory write error
Run php artisan marketpro:sync-uploads to recreate directories. Ensure your web server user owns public/uploads/: chown -R www-data:www-data public/uploads
πŸ’‘
After every deployment or file change:
php artisan cache:clear && php artisan view:clear && php artisan route:clear && php artisan config:clear
πŸ’‘
AI features not showing: Check that (1) ANTHROPIC_API_KEY is set in .env, (2) the master AI switch is ON in Admin β†’ AI Features, and (3) the specific feature toggle is ON.