title: displaying multiple images from database in laravel
body: <p>i am new to laravel and i want to ask how to display multiple images that is located in the database.</p>
  
  <p>i have already inserted images in my database through this code</p>
  
  <p>here is my try.blade.php.</p>
  
  <pre><code>&lt;h3&gt;Upload Image&lt;/h3&gt;
  &lt;form name="form" action="imageupload" method="POST" enctype="multipart/form- 
  data"&gt;
  &lt;input type="hidden" name="_token" value="{{csrf_token()}}"&gt;
  &lt;input type="file" name="img[]" multiple="true"&gt;
  &lt;br&gt;&lt;br&gt;
  &lt;input type="submit" name="ok" value="Upload"&gt;
  
  &lt;/form&gt;
  
  @if(Session::has('msg'))
  {{ Session::get('msg')}}
  @endif
  </code></pre>
  
  <p>and here is my web.php</p>
  
  <pre><code>Route::get('imageup','userLog@imageup');
  Route::post('imageupload','userLog@imageupup');
  </code></pre>
  
  <p>and here is my controller</p>
  
  <pre><code>public function imageup(){
  
      return view('try');
  }
  
  public function imageupup(Request $request){
  
          if($request-&gt;hasFile('img')){
  
                  $image_array = $request-&gt;file('img');
                  $array_len = count($image_array);
                  for($i=0; $i&lt;$array_len; $i++){
  
                      $image_size = $image_array[$i]-&gt;getClientSize();
                      $image_ext = $image_array[$i]-&gt;getClientOriginalExtension();
  
                      $new_image_name = rand(1234,9999).".".$image_ext;
                      $destination_path = public_path('/images');
                      $image_array[$i]-&gt;move($destination_path,$new_image_name);
  
                      $tab = new Tab1;
                      $tab-&gt;image_size = $image_size;
                      $tab-&gt;image_name = $new_image_name;
                      $tab-&gt;save();
                  }
  
                  return back()-&gt;with('msg','Images Uploade Successfully');
          }
  
          else{
              return back()-&gt;with('msg','Please choose any image file');
          }
  }
  </code></pre>
  
  <p>this is the code in my table</p>
  
  <pre><code>Schema::create('tab1s', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;string('image_name');
          $table-&gt;string('image_size');
          $table-&gt;timestamps();
      });
  </code></pre>
  
  <p>i hope someone can help me. </p>