orderBy('created_at', 'desc') ->get(); foreach ($uploadsToProcess as $upload) { $this->output->writeln(sprintf('Processing upload #%d', $upload->id)); $this->handleUpload($upload); } } private function handleUpload(Upload $upload) { $photos = $upload->uploadPhotos; foreach ($photos as $photo) { $this->handlePhoto($photo); } } private function handlePhoto(UploadPhoto $uploadPhoto) { $photo = $uploadPhoto->photo; $this->output->writeln(sprintf('Analysing photo #%d: %s', $photo->id, $photo->name)); /** @var Album $album */ $album = $photo->album; $albumSource = $album->getAlbumSource(); $photoFile = $albumSource->getPathToPhoto($album, $photo); dump(@exif_read_data($photoFile)); } }