mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 13:34:36 -04:00
Softdelete/restore invitations on clientcontact delete/restore
This commit is contained in:
parent
1d9c19d218
commit
2c93efface
@ -139,6 +139,21 @@ class ClientContact extends Authenticatable implements HasLocalePreference
|
|||||||
return $this->belongsTo(User::class)->withTrashed();
|
return $this->belongsTo(User::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function invoice_invitations()
|
||||||
|
{
|
||||||
|
return $this->hasMany(InvoiceInvitation::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function quote_invitations()
|
||||||
|
{
|
||||||
|
return $this->hasMany(QuoteInvitation::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function credit_invitations()
|
||||||
|
{
|
||||||
|
return $this->hasMany(CreditInvitation::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function sendPasswordResetNotification($token)
|
public function sendPasswordResetNotification($token)
|
||||||
{
|
{
|
||||||
$this->notify(new ClientContactResetPassword($token));
|
$this->notify(new ClientContactResetPassword($token));
|
||||||
|
@ -45,7 +45,9 @@ class ClientContactObserver
|
|||||||
*/
|
*/
|
||||||
public function deleted(ClientContact $clientContact)
|
public function deleted(ClientContact $clientContact)
|
||||||
{
|
{
|
||||||
//
|
$clientContact->invoice_invitations()->delete();
|
||||||
|
$clientContact->quote_invitations()->delete();
|
||||||
|
$clientContact->credit_invitations()->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -56,7 +58,9 @@ class ClientContactObserver
|
|||||||
*/
|
*/
|
||||||
public function restored(ClientContact $clientContact)
|
public function restored(ClientContact $clientContact)
|
||||||
{
|
{
|
||||||
//
|
$clientContact->invoice_invitations()->restore();
|
||||||
|
$clientContact->quote_invitations()->restore();
|
||||||
|
$clientContact->credit_invitations()->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user