phpvms/app/Listeners/ExpenseListener.php
Nabeel S ea3ab21beb
391 Notification refactorings (#441)
* Refactor notifications to allow easier plugins

* Notification refactoring

* Formatting

* Move news to NewsService; cleanup of events

* More refactoring; added send email out for news item and the template

* Formatting

* Formatting
2019-11-20 10:16:01 -05:00

34 lines
773 B
PHP

<?php
namespace App\Listeners;
use App\Contracts\Listener;
use App\Events\Expenses;
class ExpenseListener extends Listener
{
/**
* Return a list of additional expenses
*
* @param Expenses $event
*
* @return mixed
*/
public function handle(Expenses $event)
{
$expenses = [];
// This is an example of an expense to return
// You have the pirep on $event->pirep, and any associated data
// The transaction group is how it will show as a line item
/*$expenses[] = new Expense([
'type' => ExpenseType::FLIGHT,
'amount' => 15000, # $150
'transaction_group' => '',
'charge_to_user' => true|false
]);*/
return $expenses;
}
}