<?php

/**
 * Touch Therapies Antigua — backend configuration.
 *
 * For production (cPanel/MySQL) set driver to 'mysql' and fill in the
 * database credentials created in cPanel » MySQL Databases.
 * For local development the 'sqlite' driver needs no setup: the database
 * file is created and seeded automatically on first request.
 */
return [
    'app' => [
        'name'      => 'Touch Therapies Antigua',
        'url'       => 'http://localhost:5173',
        'debug'     => true,               // set false in production
        'timezone'  => 'America/Antigua',
        // URL prefix the backend is served under, e.g. '/backend' when it
        // lives in public_html/backend. null = detect automatically.
        'base_path' => null,
    ],

    'db' => [
        'driver'   => getenv('DB_DRIVER') ?: 'sqlite',   // 'mysql' in production

        // MySQL (production)
        'host'     => getenv('DB_HOST') ?: 'localhost',
        'port'     => 3306,
        'database' => getenv('DB_NAME') ?: 'touch_therapies',
        'username' => getenv('DB_USER') ?: 'touch_user',
        'password' => getenv('DB_PASS') ?: '',
        'charset'  => 'utf8mb4',

        // SQLite (local development)
        'sqlite_path' => __DIR__ . '/storage/app.sqlite',
    ],

    'security' => [
        'session_name'   => 'tt_admin',
        'rate_limit'     => ['max' => 8, 'window' => 300], // contact form: 8 posts / 5 min / IP
        'upload_dir'     => dirname(__DIR__) . '/uploads',
        'upload_max_kb'  => 8192,
        'allowed_images' => ['jpg', 'jpeg', 'png', 'webp', 'gif'],
    ],

    'mail' => [
        // Optional SMTP for contact notifications. Leave host empty to disable
        // (submissions are always stored in the database either way).
        'host'     => '',
        'port'     => 587,
        'username' => '',
        'password' => '',
        'from'     => 'no-reply@touchtherapiesantigua.com',
        'to'       => 'islandmassage@hotmail.com',
    ],
];
