flexisip-account-manager/flexiapi/app/ExternalAccount.php
Timothée Jaussoin 7a17897193 Add ExternalAccounts and related features
- Consume an ExternalAccount on Account creation
- Add a tombstone to an ExternalAccount to ensure non re-usage
- Add related tests
- Generalize Utils
- Stop public registration when there is no ExternalAccounts left
- Add GenerateExternalAccounts, ExportToExternalAccounts and ImportExternalAccounts console scripts
- Provision the ExternalAccount using the depends_on/idkey pair
2022-07-12 17:05:17 +02:00

26 lines
534 B
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ExternalAccount extends Model
{
use HasFactory;
public function account()
{
return $this->belongsTo('App\Account');
}
public function getIdentifierAttribute()
{
return $this->attributes['username'].'@'.$this->attributes['domain'];
}
public function getResolvedRealmAttribute()
{
return config('app.realm') ?? $this->attributes['domain'];
}
}