<?php

namespace App\Modules\Frontend\Models;

use CodeIgniter\Model;

class LeadModel extends Model
{
    protected $DBGroup          = 'default';
    protected $table            = 'leads';
    protected $primaryKey       = 'id';
    protected $useAutoIncrement = true;
    protected $returnType       = 'array';
    protected $useSoftDeletes   = false;
    protected $allowedFields    = ['email', 'purpose', 'ip_address'];
    protected $useTimestamps    = true;
    protected $createdField     = 'created_at';

    protected $validationRules = [
        'email' => 'required|valid_email',
        'purpose' => 'required|in_list[packing_list,newsletter]',
        'ip_address' => 'required|valid_ip',
    ];
}