D
Engineering

Database

MongoDB as the primary database with 4 connections, no migrations as schema source, and a seeder pattern for structural changes.

The primary database is MongoDB (77 of 79 models), not MySQL. Two models use Eloquent MySQL: UserAspire, UserRole.

Key points (see Indonesian version for details):

  • 4 connections: mongodb (default), crm, covendor, mysql
  • config/database.php:18 defaults to mysql.env must set DB_CONNECTION=mongodb
  • No migrations as schema source — use seeders for structural changes (e.g., BackfillWalletFieldsSeeder)
  • All MongoDB models use UUID string primary keys, generated in boot()
  • To learn a collection’s shape: read the controller that writes it + related seeder