cardinalhorizon / VAOS

Virtual Aviation Operations System
http://www.fsvaos.net
GNU General Public License v3.0
47 stars 20 forks source link

Issue displaying stats #59

Closed MrDalle closed 7 years ago

MrDalle commented 7 years ago

Hey!

i like to display the average landing rate also on the dashbaord. We merged oneui with vaos and its working so far but implementing {{ \App\PIREP::where('user_id', $user->id)->avg('landingrate') }} or other functions getting an error _1ab51cd870088c9359c6ecc434b75542-png

BossOfGames commented 7 years ago

Unless you're sending the $user variable to the view in the controller, you need to pull the logged in user. To do so, use the Auth Facade via Auth::user()->id

MrDalle commented 7 years ago

With the help of Mario i made a new oneuicontroller and store evrything there. A bit more handy then calling Auth::user()->id