Now we have all the required code on the API to accept URLs. Let's see the changes required on the frontend to be able to post the URL and show the result on the wall. As usual, let's have a look at a screenshot of the folder structure and new files.
Let's create a new entity to store the data related to a link. This class is really easy and just contains getters and setters for the column names. Let's see a couple of examples and the list of properties contained inside the class.
protected $id = null; protected $userId = null; protected $url = null; protected $title = null; protected $createdAt = null; protected $updatedAt = null;
Now let's see two simple getters and setters.
public function setTitle($title) { $this->title = $title; } public function setUpdatedAt($updatedAt) { $this->updatedAt = new \DateTime($updatedAt); } public function getId() { return $this->id; } public function getUserId() { return $this->...