title: resize image based on query string
body: <p>I'm using Laravel. I want to resize images and create thumbnail based on query string.</p>
  
  <p>For example, if someone requests <code>example.com/1.jpg?width=120</code> or <code>example.com/anything/1.jpg?width=120</code>, the original image must change to the new resized image.</p>
  
  <p>In fact, all I want is the routing system for image files like <code>.jpg</code> and <code>.png</code> where has a query string.</p>
  
  <p>is there any way in PHP or Laravel to get all request for images files with query string and manipulate it?</p>
  
  <hr>
  
  <p>Update:
  I tested @iftikhar-uddin answer.
  it work for single request. like when i request this url directly <code>example.com/anything/1.jpg?width=120</code> in browser.</p>
  
  <p>but i want to get all images and manipulate them when page is loading.</p>
  
  <p>example :
  i have multiple html tag like this <code>&lt;img src="/anything/1.jpg?width=120"&gt;</code>
  and when page is loading, i want to get all images and manipulate them by the size of query string.</p>
  
  <p><strong>what i did before ?</strong>
  currently i wrote a class for this. but the problem is i can't find original directory of images in some case.
  in my class :
  1- i get image source and size in image tag like this <code>&lt;img src="{{class::cache($model-&gt;image, 'small')}}"&gt;</code></p>
  
  <p>2- then i resize image based on size in my class (with <a href="http://image.intervention.io" rel="nofollow noreferrer">image.intervention.io</a>).</p>
  
  <p>3- but in some case (like when i'm using lfm package) the route of image and the real directory are different. so i get error when i want resize image based on source.(the directory is '/public/share/image.jpg' but route is 'laravel-filemanager/share/image.jpg')</p>
  
  <p>for that reason, i'm searching for a way to get images by url when page is loading, not by source we insert in image tag. i think this way must be much easier.</p>