Move the model callbacks into Observables; reduce caching since it held balances incorrectly

This commit is contained in:
Nabeel Shahzad
2018-03-18 20:37:35 -05:00
parent 6b002f24a8
commit 36ea12e135
25 changed files with 336 additions and 266 deletions

View File

@@ -102,7 +102,7 @@ class Pirep extends BaseModel
* Get the flight ident, e.,g JBU1900
* @return string
*/
public function getIdentAttribute()
public function getIdentAttribute(): string
{
$flight_id = $this->airline->code;
$flight_id .= $this->flight_number;
@@ -196,7 +196,7 @@ class Pirep extends BaseModel
* Look up the flight, based on the PIREP flight info
* @return Flight|null
*/
public function getFlightAttribute()
public function getFlightAttribute(): ?Flight
{
$where = [
'airline_id' => $this->airline_id,