Courses

Re-creating Booking.com API with Laravel and PHPUnit

Property Photos: Upload and Show URLs

Now it's time to take care of the photos for the properties. Each property may have multiple photos, assign order position to them, and one of them should be marked "main". Simple, right?


Goals of This Lesson

  • Add photo upload feature with Spatie Laravel Media Library package
  • Endpoint to reorder the photos
  • Show photos in search results and property detail endpoints

By the end of this lesson, we will have this list of photos returned in Postman:


Preparing For Photo Upload

Personally, I'm a big fan of the package spatie/laravel-medialibrary to manage images. So we will try to use exactly that one...

The full lesson is only for Premium Members.
Want to access all 23 lessons of this course? (224 min read)

You also get:

  • 73 courses
  • Premium tutorials
  • Access to repositories
  • Private Discord