feat: Implement client status validation on login, refine password rules, and simplify customer resource status.
This commit is contained in:
@@ -26,7 +26,7 @@ class DnsDomain extends Model
|
||||
|
||||
public function customer()
|
||||
{
|
||||
return $this->belongsToMany(Customer::class, 'dns_domain_user', 'domain_id', 'customer_id')->withTimestamps();
|
||||
return $this->belongsToMany(Customer::class, 'dns_domain_user', 'domain_id', 'user_id')->withTimestamps();
|
||||
}
|
||||
|
||||
public function server()
|
||||
|
||||
@@ -34,6 +34,11 @@ class Invoice extends Model
|
||||
return $this->belongsTo(\App\Models\Order::class, 'id', 'invoice_id');
|
||||
}
|
||||
|
||||
public function attachments()
|
||||
{
|
||||
return $this->hasMany(\App\Models\InvoiceAttachment::class);
|
||||
}
|
||||
|
||||
public function getStatus()
|
||||
{
|
||||
return match ($this->attributes['status']) {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class InvoiceAttachment extends Model
|
||||
{
|
||||
protected $table = 'invoice_attachments';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
protected $appends = ['url'];
|
||||
|
||||
public function invoice()
|
||||
{
|
||||
return $this->belongsTo(Invoice::class);
|
||||
}
|
||||
|
||||
public function getUrlAttribute(): string
|
||||
{
|
||||
return Storage::disk($this->disk)->url($this->path);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user