Appearance
Database setup
ExchangePro uses Laravel migrations. All tables are created with:
bash
php artisan migrateUse --force in production.
Supported databases
| Driver | Use case |
|---|---|
| mysql | Production (recommended) |
| mariadb | Production |
| sqlite | Local 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_here3. Migrate
bash
php artisan migrateSQLite (development only)
bash
touch database/database.sqlite.env:
ini
DB_CONNECTION=sqlite
# comment out DB_HOST, DB_DATABASE, DB_USERNAME, DB_PASSWORDbash
php artisan migrateWARNING
Do not use SQLite in production for concurrent exchange workloads.
Main tables (reference)
| Table | Purpose |
|---|---|
users | Customers and administrators (role: user | admin) |
settings | Key-value JSON blobs (general, SEO, home page, etc.) |
currencies | Exchange currencies and rates |
currency_prices | External/synced reference rates |
currency_form_fields | Dynamic proof form schema |
transactions | Exchange orders |
blogs, blog_categories | Blog CMS |
legal_pages | Policy pages |
support_tickets, support_ticket_replies, attachments | Support system |
contact_submissions | Contact form |
subscribers | Newsletter emails |
ip_blocks | IP deny rules |
report_feature_submissions | Feedback |
app_notifications | In-app notifications |
sessions, cache, jobs | Laravel 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:seedWhen SEED_DEMO_ACCOUNTS=true (default in .env.example) or APP_ENV=local, this creates:
| Role | Password | After login | |
|---|---|---|---|
| Admin | admin@example.com | password | /admin |
| Customer | customer@example.com | password | /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:freshThis deletes all data. Never run on production without backup.
Backup
Production backup example:
bash
mysqldump -u exchangepro -p exchangepro > backup-$(date +%F).sqlSchedule daily backups on your host.
Troubleshooting
| Error | Fix |
|---|---|
Access denied for user | Check DB credentials in .env |
Base table or view not found | Run php artisan migrate |
Specified key was too long | Use utf8mb4; MySQL 5.7+ or MariaDB 10.3+ |