From 6518ad34473d0a3af34185956c2074a92ef5e7f9 Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Tue, 8 Dec 2020 00:07:53 +0000 Subject: [PATCH] Fixed #2 This method would always fail for cached options because at the end it was expecting an Eloquent model, which would never be populated if the requested value was cached in the first place. Uncached requests wouldn't fail because the exec path would lead to $value being a Model. Also removed reference to old feature causing application page to crash. --- app/Helpers/Options.php | 4 +++- app/Team.php | 2 ++ resources/views/dashboard/user/viewapp.blade.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Helpers/Options.php b/app/Helpers/Options.php index 925d910..527eac9 100755 --- a/app/Helpers/Options.php +++ b/app/Helpers/Options.php @@ -39,9 +39,11 @@ class Options } Cache::put($option, $value); Cache::put($option.'_desc', 'Undefined description'); + + return $value->option_value; } - return $value->option_value; + return $value; } public function setOption(string $option, string $value, string $description) diff --git a/app/Team.php b/app/Team.php index 77c372b..7705421 100755 --- a/app/Team.php +++ b/app/Team.php @@ -37,6 +37,8 @@ class Team extends TeamworkTeam return $this->belongsToMany('App\Vacancy', 'team_has_vacancy'); } + + public function files() { return $this->hasMany('App\TeamFile', 'team_id'); diff --git a/resources/views/dashboard/user/viewapp.blade.php b/resources/views/dashboard/user/viewapp.blade.php index 3054c36..5ec4335 100755 --- a/resources/views/dashboard/user/viewapp.blade.php +++ b/resources/views/dashboard/user/viewapp.blade.php @@ -348,7 +348,7 @@
- +