Refactor script

This commit is contained in:
furen81
2026-02-07 04:52:11 +07:00
parent 6e681c4ad3
commit c1ef2df512
20 changed files with 1608 additions and 118 deletions

37
app/Models/Agent.php Normal file
View File

@ -0,0 +1,37 @@
<?php
namespace App\Models;
use MongoDB\Laravel\Eloquent\Model;
class Agent extends Model
{
protected $connection = 'mongodb';
protected $collection = 'agents';
protected $fillable = [
'agent_id',
'company_name',
'email',
'phone',
'address',
'subscription_duration',
'is_active',
'api_secret_key',
'ip_whitelist',
'password',
'role', // [NEW] 'master' or 'agent'
'username', // [NEW] For login
'employee_id', // [NEW] User preference for login ID
];
protected $hidden = [
'password',
];
protected $casts = [
'subscription_duration' => 'integer',
'is_active' => 'boolean',
'ip_whitelist' => 'array',
];
}