title: How to Route back with passing parameters using Laravel?
body: <p>I am working on Laravel 5.0. I want to return back from my current page to the previous page with passing parameter. I have an id of all images and galleries in my urls. After clicking on a particular image, i move to another page with the id of that image in my url, Now, i want to return back to my gallery page to which that image belongs to.</p>
  
  <p>My controller:</p>
  
  <pre><code>   public function viewgallerypics($id){
          $gallery= Gallery::findorFail($id);
          return view('dropzone' , ['gallery'=&gt;$gallery]);
           }
  
      public function bigimage($id){
         $gallery=Gallery::all();
         $image=image::findorFail($id);
         return view('bigimage' , ['image'=&gt;$image,'gallery'=&gt;$gallery]);
  
         }
  </code></pre>
  
  <p>My routes:</p>
  
  <pre><code>       Route::get('/image/big/{id}' ,[
         'uses'=&gt;'GalleryController@bigimage',
         'as'=&gt;'bigimage'
         ]);
  
  
         Route::get('/gallery/view/{id}' ,[
         'uses'=&gt;'GalleryController@viewgallerypics',
         'as'=&gt;'viewpics'
         ]);
  </code></pre>
  
  <p>My view:</p>
  
  <pre><code>    &lt;section class="col-md-1"&gt;
      &lt;a class="btn btn-primary btn-lg" 
      href="HERE, WHAT I HAVE TO PASS TO GET MY DESIRED
      PAGE????"&gt;Back&lt;/a&gt;
      &lt;/section&gt;
  </code></pre>
  
  <p>My desired page where i want to return back depending on the id pass through the route:</p>
  
  <pre><code> &lt;div class="row"&gt;
   &lt;div class="col-md-offset-1 col-md-10"&gt;
   &lt;div  id="gallery-images"&gt;
   &lt;ul&gt;
   @foreach($gallery-&gt;images as $image)
   &lt;li&gt;
   &lt;a href="{{ URL('/image/big/'.$image-&gt;id) }}"&gt;
   &lt;img id="jumboimage2" src="{{   url($image-&gt;file_path) }}"&gt;&lt;/a&gt;
   &lt;/li&gt;
   &lt;li&gt;
   &lt;a href="{{ URL('/image/delete/'.$image-&gt;id) }}" id="margin"&gt;
   &lt;span id="margin" class="glyphicon glyphicon-remove-sign"&gt;&lt;/span&gt;&lt;/a&gt;
   &lt;/li&gt;
   @endforeach
   &lt;/ul&gt;
   &lt;/div&gt;
   &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>