public function getPreference($key) { // We can't use $this->preferences directly, since the data has been tampered // by getPreferencesAttribute(). return array_get((array) unserialize($this->attributes['preferences']), $key); }