6 changed files with 66 additions and 22 deletions
-
26app/Http/Controllers/ContractImageController.php
-
2app/Http/Controllers/SearchAndDisplaceController.php
-
30app/SearchDisplace/Documents/DocumentFile.php
-
18app/SearchDisplace/Ingest/HandleReceivedDocument.php
-
10app/SearchDisplace/SearchAndDisplaceFromFiles.php
-
2routes/web.php
@ -0,0 +1,26 @@ |
|||||
|
<?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; |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue