phpvms
phpvms copied to clipboard
Added is_flying Attribute to User Model
Based on feedback and conversations on discord. I added a isflying boolean.
@BossOfGames is this still active?
I would change this to use
latest('updated_at')
. In case there is a bugged/old PIREP.
Even with the change you suggest @nabeelio , there is still a risk of getting false positives. If there are broken pireps in the database, this will always return true because of the state check in where clause 😞
To avoid this maybe we can use the user's latest pirep only and return the result according to it's state. At least this will recude the risk to a single pirep being broken or not.
$pirep = Pirep::where('user_id' => $this->id)->latest('updated_at')->first();
return ($pirep->state === PirepState::IN_PROGRESS) ? true : false;
Similar logic can be implemented for aircraft too (maybe with some new enums defined, like BOOKED, PLANNED etc.)
And considering no replies since 5th March, I think OP does not follow or not interested in this change anymore.