phpvms/app/Listeners/ExpenseListener.php

36 lines
829 B
PHP
Raw Normal View History

<?php
namespace App\Listeners;
use App\Contracts\Listener;
2019-07-16 03:51:35 +08:00
use App\Events\Expenses;
use App\Models\Enums\ExpenseType;
use App\Models\Expense;
class ExpenseListener extends Listener
{
/**
* Return a list of additional expenses
2018-08-27 00:40:04 +08:00
*
* @param Expenses $event
2018-08-27 00:40:04 +08:00
*
* @return mixed
*/
public function handle(Expenses $event)
{
$expenses = [];
2018-08-27 00:40:04 +08:00
// 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' => 150, # $150
'transaction_group' => '',
'charge_to_user' => true|false
]);*/
return $expenses;
}
}