public function __toString() { // TODO: Implement __toString() method. //Form: {{username}} {{action}} {{object}} //Nhuan likes your post //Tung follow you $noti = ""; $action = ""; $username = ""; $type = ""; if ($this["type"] == FOLLOW) { $action = " follow "; if ($this["objectType"] == USER) { $type = " you "; } else { $board_title = Board::getBoardById($this->objectID)["board_title"]; $type = " your board " . ' ' . $board_title; } } else { $type = "your post "; if ($this["type"] == LIKE) { $action = " liked "; } else { if ($this["type"] == COMMENT) { $action = " comment on "; } else { if ($this["type"] == PIN) { $action = " pinned "; } } } } if (isset($this["sender_id"])) { $username = User::getUserById($this["sender_id"])["name"]; } else { $username = $this["sender_string"]; } $noti = $username . $action . $type; return $noti; }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // $result = Board::getBoardById($id); return response()->json($result); }