api = new BattleNet(null,$key); } public function getColorAttribute($type=""){ switch($this->difficulty){ case 'Normal': return "shaman"; case 'Heroic': return "warlock"; case 'Mythic': return "deathknight"; case 'Teamspeak': return "hunter"; default: return "priest"; } } public function getLinkAttribute(){ return "/raid/".$this->ID; } public function getPreviousAttribute(){ $id = $this->ID; while($id){ $raid = Raid::find(--$id); if(!empty($raid->ID)){ return $raid; } } return false; } public function getNextAttribute(){ $id = $this->ID; while($id <= Raid::max('ID')){ $raid = Raid::find(++$id); if(!empty($raid->ID)){ return $raid; } } return false; } }