Repo for the search and displace core module including the interface to select files and search and displace operations to run on them. https://searchanddisplace.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
564 B

  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Support\Facades\File;
  4. use Illuminate\Support\Facades\Response;
  5. class ContractImageController extends Controller
  6. {
  7. public function show($id, $image)
  8. {
  9. $path = storage_path('app/contracts/' . $id . '/' . $image);
  10. if ( ! File::exists($path)) {
  11. abort(404);
  12. }
  13. $file = File::get($path);
  14. $type = File::mimeType($path);
  15. $response = Response::make($file, 200);
  16. $response->header("Content-Type", $type);
  17. return $response;
  18. }
  19. }