phpvms/app/Events/Expenses.php
Nabeel S e99c22b007
Notifications fixes (#804)
* Emails not sending #795 #722

* Fix for news items not being sent; refactor some events; check for opt-in #722

* Formatting

* Remove extra parameter
2020-09-03 12:50:42 -04:00

41 lines
892 B
PHP

<?php
namespace App\Events;
use App\Contracts\Event;
use App\Models\Pirep;
/**
* This event is dispatched when the expenses for a flight report
* are collected. Your listeners should return a list of Expense
* models. Don't call save on the model!
*
* Example return:
*
* [
* new Expense([
* 'airline_id': '', # < optional field
* 'name': '',
* 'amount': [DECIMAL],
* 'type': int from ExpenseType enum class
* ]),
* ]
*
* The event caller will check the 'type' to make sure that it
* will filter out expenses that only apply to the current process
*
* The event will have a copy of the PIREP model, if it's applicable
*/
class Expenses extends Event
{
public $pirep;
/**
* @param Pirep|null $pirep
*/
public function __construct(Pirep $pirep = null)
{
$this->pirep = $pirep;
}
}