mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 00:27:32 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			359 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			359 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php namespace app\Listeners;
 | 
						|
 | 
						|
use App\Models\Task;
 | 
						|
use App\Events\InvoiceWasDeleted;
 | 
						|
 | 
						|
class TaskListener
 | 
						|
{
 | 
						|
    public function deletedInvoice(InvoiceWasDeleted $event)
 | 
						|
    {
 | 
						|
        // Release any tasks associated with the deleted invoice
 | 
						|
        Task::where('invoice_id', '=', $event->invoice->id)
 | 
						|
                ->update(['invoice_id' => null]);
 | 
						|
    }
 | 
						|
}
 |