| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- /**
- * @property int $id
- * @property int $unit_id
- * @property string|null $asaas_api_key
- * @property string $status
- * @property \Illuminate\Support\Carbon|null $onboarded_at
- * @property \Illuminate\Support\Carbon|null $created_at
- * @property \Illuminate\Support\Carbon|null $updated_at
- * @property-read \App\Models\Unit $unit
- */
- class UnitPaymentAccount extends Model
- {
- use HasFactory;
- public const STATUS_PENDING = 'pending';
- public const STATUS_ACTIVE = 'active';
- protected $table = 'unit_payment_accounts';
- protected $guarded = ['id'];
- protected $casts = [
- // Cifra/decifra automaticamente usando a APP_KEY.
- 'asaas_api_key' => 'encrypted',
- 'onboarded_at' => 'datetime',
- 'created_at' => 'datetime',
- 'updated_at' => 'datetime',
- ];
- public function unit(): BelongsTo
- {
- return $this->belongsTo(Unit::class, 'unit_id');
- }
- }
|