|null $phone_numbers * @property string|null $billing_username * @property string|null $billing_password * @property string|null $billing_swift_username * @property string|null $billing_swift_password * @property string|null $billing_visa_master_username * @property string|null $billing_visa_master_password * @property string|null $billing_sber_username * @property string|null $billing_sber_password * @property bool $active * @property \Illuminate\Support\Carbon $created_at * @property \Illuminate\Support\Carbon $updated_at */ class Branch extends Model { use HasTranslations; /** * Table name * * @var string */ protected $table = 'branches'; /** * Translatable fields * * @var array */ public $translatable = [ 'name', 'address', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'active' => 'boolean', 'phone_numbers' => 'array', ]; /** * Province relationship * * @return BelongsTo */ public function province(): BelongsTo { return $this->belongsTo(Province::class); } /** * Branches associated with user */ public function users(): BelongsToMany { return $this->belongsToMany(User::class); } /** * Get billing username */ public function billingUsername(): string { return $this->billing_username ?: '-'; } /** * Get billing password */ public function billingPassword(): string { return $this->billing_password ?: '-'; } }