Refactor script
This commit is contained in:
37
app/Models/Agent.php
Normal file
37
app/Models/Agent.php
Normal 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',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user