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
26 lines
564 B
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Support\Facades\File;
|
|
use Illuminate\Support\Facades\Response;
|
|
|
|
class ContractImageController extends Controller
|
|
{
|
|
public function show($id, $image)
|
|
{
|
|
$path = storage_path('app/contracts/' . $id . '/' . $image);
|
|
|
|
if ( ! File::exists($path)) {
|
|
abort(404);
|
|
}
|
|
|
|
$file = File::get($path);
|
|
$type = File::mimeType($path);
|
|
|
|
$response = Response::make($file, 200);
|
|
$response->header("Content-Type", $type);
|
|
|
|
return $response;
|
|
}
|
|
}
|