title: images not showing using spatie media library in Laravel 8
body: <p>I am having trouble displaying the images uploaded using spatie media library. I already looked in their documentation but I can't find a solution.</p>
  <p>I had no issue uploading files (single file only).</p>
  <p><strong>The Database Media Table</strong>
  <a href="https://i.stack.imgur.com/JpGto.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JpGto.png" alt="screenshot of Database Media Table" /></a></p>
  <p><strong>Controller @ store</strong></p>
  <pre><code>public function store(Request $request)
  {
      $categories = new ProductCategories();
      $categories-&gt;name         = $request-&gt;name;
      $categories-&gt;slug         = $request-&gt;slug;
      $categories-&gt;description  = $request-&gt;description;
  
      if($request-&gt;hasFile('photo') &amp;&amp; $request-&gt;file('photo')-&gt;isValid()){
          $categories-&gt;addMediaFromRequest('photo')-&gt;toMediaCollection('category');
      }
  
      $categories-&gt;save();
      $request-&gt;session()-&gt;flash('message', 'Successfully created category');
      return redirect()-&gt;back();
  }
  </code></pre>
  <p><strong>Controller @ index</strong></p>
  <pre><code>public function index()
  {
      $lists = ProductCategories::all();
      return view('dashboard\product_category\categoryList', [ 'lists' =&gt; $lists ]);
  }
  </code></pre>
  <p><strong><code>config/filesystems.php</code></strong></p>
  <pre><code>'disks' =&gt; [
      'local' =&gt; [
          'driver' =&gt; 'local',
          'root' =&gt; storage_path('app'),
      ],
      'public' =&gt; [
          'driver' =&gt; 'local',
          'root' =&gt; public_path('images/media'),
          'url' =&gt; env('APP_URL').'/images/media',
          'visibility' =&gt; 'public',
      ],
      's3' =&gt; [
          'driver' =&gt; 's3',
          'key' =&gt; env('AWS_ACCESS_KEY_ID'),
          'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),
          'region' =&gt; env('AWS_DEFAULT_REGION'),
          'bucket' =&gt; env('AWS_BUCKET'),
          'url' =&gt; env('AWS_URL'),
      ],
  ],
  </code></pre>
  <p><strong><code>config/media-library.php</code></strong></p>
  <pre><code>'disk_name' =&gt; env('MEDIA_DISK', 'public'),
  </code></pre>
  <p>These are my media folders:</p>
  <pre><code>wamp64/www/butingting/public/images/media/2
  wamp64/www/butingting/public/images/media/3
  wamp64/www/butingting/public/images/media/4
  </code></pre>
  <p><strong>Blade page</strong></p>
  <pre><code> @foreach ($lists as $list)
       &lt;tr&gt;
            &lt;td&gt;
                &lt;img src=&quot;{{$list-&gt;getFirstMediaUrl('category')}}&quot; width=&quot;120px&quot;&gt;&lt;br/&gt;
                {{$list-&gt;getFirstMediaUrl('category')}}
            &lt;/td&gt;
       &lt;/tr&gt;
   @endforeach
  </code></pre>
  <p>If I add <code>{{$list-&gt;getFirstMediaUrl('category')}}</code>, it looks like this:</p>
  <p><a href="https://i.stack.imgur.com/W0W0g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W0W0g.png" alt="enter image description here" /></a></p>
  <p>I already done the &quot;php artisan storage:link&quot;</p>
  <p>any suggestions?</p>