For each image uploaded in a node: get the url I'm begining with Drupal 8 and I want to get the url of the photos in the content I create to display them.
 The context is : a photograph upload pictures for a customer. This customer can see it on a page. To get this data in common I created a content for my shooting with an id.
 What i did is : 

$photos = $shooting-&gt;field_shooting_photos-&gt;target_id;


This allow me to get the id of every pictures uploaded.
Now I want to do a foreach on $photos in my .module that will return every url in an array. 
Then I will use this array in my Twig and do a foreach on it too to return every photos. 
I just can't figure out how to do, I think I will have to use something like that 

$path = $photo_id-&gt;getFileUri();


but I can't figure out the syntax to get it into an array.
Thank you for your help!
Solution :
Here is what I did in case it can help someone : 

$photosTest = $shooting-&gt;field_shooting_photos-&gt;referencedEntities();

$photoUrls = [];

foreach($photosTest as $media) {
  $photoUrls[] =
  $photoUrls[] = [
      'render' =&gt; [
         '#theme' =&gt; 'image_style',
         '#style_name' =&gt; 'medium',
         '#uri' =&gt; $media-&gt;field_media_image-&gt;entity-&gt;getFileUri()
       ],
       'href' =&gt; $media-&gt;field_media_image-&gt;entity-&gt;getFileUri(),
     ];
}


In my Twig file I render the array : 

&lt;div&gt;
 {% for photo in photos %}
    &lt;a href="{{ file_url(photo.href) }}"&gt;{{ photo.render }}&lt;/a&gt;
 {% endfor %}
&lt;/div&gt;
Giving field_shooting_photos is a multi valued field of Files, this is how to generate your array of URI :

$photoUrls = [];
foreach($shooting-&gt;field_shooting_photos-&gt;referencedEntities() as $image) {
    $photoUrls[] = $image-&gt;getFileUri();
}


For media image :

$photoUrls = [];
foreach($shooting-&gt;field_shooting_photos-&gt;referencedEntities() as $media) {
    $photoUrls[] = $media-&gt;field_media_image-&gt;entity-&gt;getFileUri();
}


Note this will give you the File_id of the first image in the entite file reference list :

$shooting-&gt;field_shooting_photos-&gt;target_id;


NB : Best way is probably to generate render array or use built-in drupal themes, is none fit your needs, your may also generate a custom field formatter.