mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 10:30:57 -04:00
- Removed unused uses - Type hinting for method parameters - Removed commented code - Introduced comments for classes and methods - Short array syntax
21 lines
444 B
PHP
21 lines
444 B
PHP
<?php namespace App\Listeners;
|
|
|
|
use App\Models\Task;
|
|
use App\Events\InvoiceWasDeleted;
|
|
|
|
/**
|
|
* Class TaskListener
|
|
*/
|
|
class TaskListener
|
|
{
|
|
/**
|
|
* @param InvoiceWasDeleted $event
|
|
*/
|
|
public function deletedInvoice(InvoiceWasDeleted $event)
|
|
{
|
|
// Release any tasks associated with the deleted invoice
|
|
Task::where('invoice_id', '=', $event->invoice->id)
|
|
->update(['invoice_id' => null]);
|
|
}
|
|
}
|