Skip to content

Database setup

ExchangePro uses Laravel migrations. All tables are created with:

bash
php artisan migrate

Use --force in production.

Supported databases

DriverUse case
mysqlProduction (recommended)
mariadbProduction
sqliteLocal development / quick demo

MySQL / MariaDB

1. Create database

sql
CREATE DATABASE exchangepro CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'exchangepro'@'localhost' IDENTIFIED BY 'strong_password_here';
GRANT ALL PRIVILEGES ON exchangepro.* TO 'exchangepro'@'localhost';
FLUSH PRIVILEGES;

2. Configure .env

ini
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=exchangepro
DB_USERNAME=exchangepro
DB_PASSWORD=strong_password_here

3. Migrate

bash
php artisan migrate

SQLite (development only)

bash
touch database/database.sqlite

.env:

ini
DB_CONNECTION=sqlite
# comment out DB_HOST, DB_DATABASE, DB_USERNAME, DB_PASSWORD
bash
php artisan migrate

WARNING

Do not use SQLite in production for concurrent exchange workloads.

Main tables (reference)

TablePurpose
usersCustomers and administrators (role: user | admin)
settingsKey-value JSON blobs (general, SEO, home page, etc.)
currenciesExchange currencies and rates
currency_pricesExternal/synced reference rates
currency_form_fieldsDynamic proof form schema
transactionsExchange orders
blogs, blog_categoriesBlog CMS
legal_pagesPolicy pages
support_tickets, support_ticket_replies, attachmentsSupport system
contact_submissionsContact form
subscribersNewsletter emails
ip_blocksIP deny rules
report_feature_submissionsFeedback
app_notificationsIn-app notifications
sessions, cache, jobsLaravel infrastructure

Home page default content is seeded via migration 2026_05_31_000002_seed_home_page_settings.php.

Seed data

Home page settings are seeded via migration 2026_05_31_000002_seed_home_page_settings.php.

Demo accounts

bash
php artisan db:seed

When SEED_DEMO_ACCOUNTS=true (default in .env.example) or APP_ENV=local, this creates:

RoleEmailPasswordAfter login
Adminadmin@example.compassword/admin
Customercustomer@example.compassword/dashboard

Full copy for your CodeCanyon item description: backend/DEMO_CREDENTIALS.txt.

Production: set SEED_DEMO_ACCOUNTS=false and do not rely on demo passwords. Create your real admin via first admin.

For automated tests, use UserFactory (database/factories/UserFactory.php).

Reset database (development)

bash
php artisan migrate:fresh

This deletes all data. Never run on production without backup.

Backup

Production backup example:

bash
mysqldump -u exchangepro -p exchangepro > backup-$(date +%F).sql

Schedule daily backups on your host.

Troubleshooting

ErrorFix
Access denied for userCheck DB credentials in .env
Base table or view not foundRun php artisan migrate
Specified key was too longUse utf8mb4; MySQL 5.7+ or MariaDB 10.3+

Need help? support@xorinlab.com · Website: xorinlab.com