mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 19:24:42 -04:00
Always load user even if they're deleted
This commit is contained in:
parent
c11ab0b742
commit
1039aec1d0
@ -19,6 +19,6 @@ class AccountToken extends EntityModel
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
return $this->belongsTo('App\Models\User')->withTrashed();
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ class Contact extends EntityModel implements AuthenticatableContract, CanResetPa
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
return $this->belongsTo('App\Models\User')->withTrashed();
|
||||
}
|
||||
|
||||
public function client()
|
||||
|
@ -8,7 +8,7 @@ class Credit extends EntityModel
|
||||
{
|
||||
use SoftDeletes;
|
||||
use PresentableTrait;
|
||||
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
protected $presenter = 'App\Ninja\Presenters\CreditPresenter';
|
||||
|
||||
@ -19,7 +19,7 @@ class Credit extends EntityModel
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
return $this->belongsTo('App\Models\User')->withTrashed();
|
||||
}
|
||||
|
||||
public function invoice()
|
||||
@ -59,9 +59,9 @@ class Credit extends EntityModel
|
||||
}
|
||||
|
||||
Credit::creating(function ($credit) {
|
||||
|
||||
|
||||
});
|
||||
|
||||
Credit::created(function ($credit) {
|
||||
event(new CreditWasCreated($credit));
|
||||
});
|
||||
});
|
||||
|
@ -91,7 +91,7 @@ class Document extends EntityModel
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
return $this->belongsTo('App\Models\User')->withTrashed();
|
||||
}
|
||||
|
||||
public function expense()
|
||||
|
@ -35,7 +35,7 @@ class Expense extends EntityModel
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
return $this->belongsTo('App\Models\User')->withTrashed();
|
||||
}
|
||||
|
||||
public function vendor()
|
||||
|
@ -24,7 +24,7 @@ class Task extends EntityModel
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
return $this->belongsTo('App\Models\User')->withTrashed();
|
||||
}
|
||||
|
||||
public function client()
|
||||
@ -91,4 +91,4 @@ class Task extends EntityModel
|
||||
{
|
||||
return round($this->getDuration() / (60 * 60), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ class Vendor extends EntityModel
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
return $this->belongsTo('App\Models\User')->withTrashed();
|
||||
}
|
||||
|
||||
public function payments()
|
||||
|
@ -9,7 +9,7 @@ class VendorContact extends EntityModel
|
||||
use SoftDeletes;
|
||||
protected $dates = ['deleted_at'];
|
||||
protected $table = 'vendor_contacts';
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
'first_name',
|
||||
'last_name',
|
||||
@ -30,7 +30,7 @@ class VendorContact extends EntityModel
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
return $this->belongsTo('App\Models\User')->withTrashed();
|
||||
}
|
||||
|
||||
public function vendor()
|
||||
|
Loading…
x
Reference in New Issue
Block a user