orderBy('rank')->get(); } public static function getLists(){ return static::distinct('list_name')->get(); } public function getCharacterAttribute(){ $char= Character::where('name',$this->char_name)->where('realm',$this->realm_name)->first(); if(!empty($char->ID)){ return $char; } $char = new Character(); $char->name = $this->char_name; $char->realm = $this->realm_name; $char->class = "yellow"; return $char; } }