AgentApplication.php 617 B

12345678910111213141516171819
  1. <?php
  2. namespace App\Models\Agent;
  3. use App\Models\BaseModel;
  4. class AgentApplication extends BaseModel
  5. {
  6. protected $table = 'agent_applications';
  7. protected $guarded = ['id'];
  8. protected $hidden = ['password_hash', 'withdraw_password_hash', 'pending_user_id', 'pending_username'];
  9. protected $casts = ['user_id' => 'integer', 'agent_id' => 'integer', 'reviewed_by' => 'integer', 'type' => 'integer'];
  10. protected $appends = ['type_text'];
  11. public function getTypeTextAttribute(): string
  12. {
  13. return Agent::TYPE_NAMES[(int) ($this->attributes['type'] ?? Agent::TYPE_JOINT)] ?? '';
  14. }
  15. }