Thanks DiposableHero ,
But nothing works for the moment, not easy when you are a beginner ,
what I did and I don't see any error, I publish here an example of what I want to put in place :
class ExpenseListener extends Listener
{
public function handle(Expenses $event)
{
$expenses = [];
$amount = 5000;
if (abs($event->pirep->landing_rate) < 500) {
return $expenses;
}
$expenses[] = new Expense([
'type' => ExpenseType::FLIGHT,
'amount' => 5000,
'transaction_group' => 'Hard Landing',
'name' => 'Hard Landing Fee For Pirep='.$event->pirep->id,
'multiplier' => false,
'charge_to_user' => true,
]);
return $expenses;
}
}
Thank you