/** * @return Overrides the API Model, will see if it can be intergrated into it */ public function getVisibleAttribute() { //Should be manually run because ... fill this in if you can think of a reason if (Auth::user()->id == $this->user_id) { $this->setVisible = array_unique(array_merge($this->creatorVisible, $this->visible)); } if ($this->user && $this->user->public) { //I'm really confused how a vote can not have a user somehow $this->setVisible = array_unique(array_merge($this->publicVisible, $this->visible)); } return parent::getVisibleAttribute(); }
/** * @return Overrides the API Model, will see if it can be intergrated into it */ public function getVisibleAttribute() { if (!Auth::check()) { return $this->visible; } if (Auth::user()->id == $this->id) { // Logged in user $this->visible = array_unique(array_merge($this->creatorVisible, $this->visible)); } if ($this->public) { //Public profile $this->visible = array_unique(array_merge($this->publicVisible, $this->visible)); } return parent::getVisibleAttribute(); }
/** * @return Overrides the API Model, will see if it can be intergrated into it */ public function getVisibleAttribute() { if (!Auth::check()) { return $this->visible; } return parent::getVisibleAttribute(); }