table = 'setting'; $this->guarded = []; } protected function _getKey() { $keyLength = strlen(env('APP_KEY')); return substr(env('APP_KEY'), round($keyLength / 2), $keyLength); } // custom display get{file_name}Attribute() public function getFaviconAttribute($value) { if ($value) { return asset("/storage/$value?key=" . $this->_getKey()); } else { return null; } } // custom display get{file_name}Attribute() public function getLogoAttribute($value) { if ($value) { return asset("/storage/$value?key=" . $this->_getKey()); } else { return null; } } }