title: How to give download option for image,pdf etc files stored in storage folder depending on type of file in Laravel?
body: <p>I am learning Laravel. I want to show image(give download option)/pdf(show name of pdf file and give download and view(view on browser, in new tab) option) depending on extension on my view.</p>
  
  <p>I have <code>file_docs</code> table. In that table I have column <code>buyers_aadhar_file</code>. In that column I am storing files like image OR pdf. I am customising name of file while storing like "buyersid_B_aadhar_nameoffile.ext" e.g <code>2_B_aadhar_Aadhaar-Card-New-Rules-Update-644x362.jpg</code> or <code>3_B_aadhar_Aadhaar-Data-Update-Form-03.pdf</code> </p>
  
  <p>Now I want to display that files depending on type of file. </p>
  
  <p>If file is image then show image also give download option for image. And if file is pdf then show name of pdf file, give download and view pdf file option for that file. </p>
  
  <p>How do I check on my view, whether that file is image or pdf and how to implement relative download and view option for that file?</p>