mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 18:37:33 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			609 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			609 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace App\Listeners;
 | 
						|
 | 
						|
use App\Events\QuoteInvitationWasViewed;
 | 
						|
use App\Events\QuoteWasEmailed;
 | 
						|
 | 
						|
/**
 | 
						|
 * Class QuoteListener.
 | 
						|
 */
 | 
						|
class QuoteListener
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * @param QuoteInvitationWasViewed $event
 | 
						|
     */
 | 
						|
    public function viewedQuote(QuoteInvitationWasViewed $event)
 | 
						|
    {
 | 
						|
        $invitation = $event->invitation;
 | 
						|
        $invitation->markViewed();
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * @param InvoiceWasEmailed $event
 | 
						|
     */
 | 
						|
    public function emailedQuote(QuoteWasEmailed $event)
 | 
						|
    {
 | 
						|
        $quote = $event->quote;
 | 
						|
        $quote->last_sent_date = date('Y-m-d');
 | 
						|
        $quote->save();
 | 
						|
    }
 | 
						|
 | 
						|
}
 |