2018-03-02 06:20:13 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Listeners;
|
|
|
|
|
|
|
|
use App\Events\Expenses;
|
|
|
|
use App\Models\Enums\ExpenseType;
|
|
|
|
use App\Models\Expense;
|
|
|
|
|
|
|
|
class ExpenseListener
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Return a list of additional expenses
|
|
|
|
* @param Expenses $event
|
2018-03-03 03:12:39 +08:00
|
|
|
* @return mixed
|
2018-03-02 06:20:13 +08:00
|
|
|
*/
|
|
|
|
public function handle(Expenses $event)
|
|
|
|
{
|
2018-03-03 03:12:39 +08:00
|
|
|
$expenses = [];
|
|
|
|
|
|
|
|
# This is an example of an expense to return
|
|
|
|
# You have the pirep on $event->pirep, and any associated data
|
2018-03-06 09:55:48 +08:00
|
|
|
# The transaction group is how it will show as a line item
|
2018-03-03 03:12:39 +08:00
|
|
|
/*$expenses[] = new Expense([
|
|
|
|
'type' => ExpenseType::FLIGHT,
|
2018-03-06 09:55:48 +08:00
|
|
|
'amount' => 15000, # $150
|
|
|
|
'transaction_group' => '',
|
2018-03-03 03:12:39 +08:00
|
|
|
]);*/
|
|
|
|
|
|
|
|
return $expenses;
|
2018-03-02 06:20:13 +08:00
|
|
|
}
|
|
|
|
}
|