From 54ed2920a0f9d4e49efec095fb9d2b14b6508a99 Mon Sep 17 00:00:00 2001 From: samwiggins Date: Mon, 28 Apr 2014 14:41:42 +0100 Subject: [PATCH] Auth::user() save issue Causes a problem when trying to save the user model when retrieving with Auth::user() SQLSTATE[42S22]: Column not found: 1054 Unknown column 'to_check_cache' in 'field list' --- models/user.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/user.php b/models/user.php index ea1e568..a9eb166 100644 --- a/models/user.php +++ b/models/user.php @@ -175,7 +175,7 @@ private function get_to_check() { $class = get_class(); - if(empty($this->to_check_cache)) + if(empty(static::$to_check_cache)) { $to_check = new $class; @@ -183,11 +183,11 @@ private function get_to_check() ->where('id', '=', $this->get_attribute('id')) ->first(); - $this->to_check_cache = $to_check; + static::$to_check_cache = $to_check; } else { - $to_check = $this->to_check_cache; + $to_check = static::$to_check_cache; } return $to_check;