title: Trying to parse files, receiving an error that has to do with SplFileInfo
body: <p>I am saving an image with the current User object and even though i'm not yielding any wanted results. I am trying to parse an array of files, in that array, I am trying to get the object key that is named <code>filename</code>.</p>
  
  <p>I currently have 2 images in this file array:</p>
  
  <pre><code>array:2 [▼
    0 =&gt; SplFileInfo {#219 ▶}
    1 =&gt; SplFileInfo {#220 ▶}
  ]
  </code></pre>
  
  <p>Each array key has an object and in that object I am looking for the filename key: </p>
  
  <p><code>filename: "oIWVAvlOyG9yMzhhvTFoYX2wGNTa2pEth7gb228Z.png"</code></p>
  
  <p>If it really matters, my code is on a controller on Laravel 5.4:</p>
  
  <pre><code>public function index(Request $request)
      {
          $user = Auth::user();
          $userImagesPath = public_path().'\\storage\\'.$user-&gt;email;
          $userImagesArray = File::allFiles($userImagesPath);
          $contents =[];
          $fileNameArray = [];
          foreach ($userImagesArray as $file){
              $contents[] = $file;
              foreach ($contents as $fileName){
                  $fileNameArray[] = $fileName-&gt;filename;
              }
          }
          dd($fileNameArray);
          return view('sharmutaView')
              -&gt;with('user', $user);
      }
  </code></pre>
  
  <p>I am getting an error: <code>Undefined property: Symfony\Component\Finder\SplFileInfo::$filename</code>, which is clearly telling me I ain't parsing right.</p>