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
|
|
|
|
/*$expenses[] = new Expense([
|
|
|
|
'type' => ExpenseType::FLIGHT,
|
|
|
|
'amount' => 15000 # $150
|
|
|
|
]);*/
|
|
|
|
|
|
|
|
return $expenses;
|
2018-03-02 06:20:13 +08:00
|
|
|
}
|
|
|
|
}
|