Showing the Uploaded Picture

Let's show the uploaded picture on the tour details page.

Displaying picture of the tour if defined

We have successfully uploaded a picture from the browser and saved it on the server in a directory (uploads) that is inside the document root (public). This means it is now accessible from the browser as well, so we are ready to show it on the tour details page. Not every tour will have a picture yet, so we always need to check if the 'picture' key is defined in the array of tour data:

Get hands-on with 1200+ tech skills courses.