phpvms/app/Listeners/ExpenseListener.php

26 lines
469 B
PHP
Raw Normal View History

<?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
* @return array
*/
public function handle(Expenses $event)
{
return [
new Expense([
'type' => ExpenseType::FLIGHT,
'amount' => 15000 # $150
]),
];
}
}