'array', ]; public function user(): BelongsTo { return $this->belongsTo(User::class); } public function userCredit(): BelongsTo { return $this->belongsTo(UserCredit::class, 'user_id', 'user_id'); } public function scopeDeposits($query) { return $query->where('operation', 'deposit'); } public function scopeSpending($query) { return $query->where('operation', 'spend'); } public function isCredit(): bool { return $this->amount > 0; } public function isDebit(): bool { return $this->amount < 0; } }