getKey(); } /** * Get the password for the user. * * @return string */ public function getAuthPassword() { return $this->password; } /** * Get the e-mail address where password reminders are sent. * * @return string */ public function getReminderEmail() { return $this->email; } public function getAvatar() { if($avatar = $this->getSetting('avatar')) { return asset('img/avatars/'.$avatar); } else { return asset('img/no-avatar.jpg'); } } public function getSetting($key, $false = false) { $settings = json_decode($this->settings); if(!is_null($settings) && property_exists($settings, $key)) return $settings->$key; else return $false; } public function setSetting($key, $value) { $settings = json_decode($this->settings); if(is_null($settings)) { $settings = array(); } $settings[$key] = $value; $this->settings = json_encode($settings); } public function films() { return $this->hasMany('Film', 'user'); } public function comments() { return $this->hasMany('Comment', 'user'); } public function votes() { return $this->hasMany('Vote', 'user'); } public function news() { return $this->hasMany('News', 'author'); } }