Image displaying continue

This commit is contained in:
Александр Бабкин
2022-07-14 22:45:19 +03:00
parent 36698241ed
commit cce02034f4
5 changed files with 120 additions and 88 deletions

View File

@@ -77,8 +77,23 @@ class MMCController extends Controller
*/
public function show(Request $request, $id)
{
// $user = User::find($id);
// return view('admin.users.show', ['user' => $user]);
$project_id = $request->session()->get('project_id');
$project = Project::find($project_id);
$mmc = MMC::find($id);
$auk = $mmc->auks()->first();
$filePath = $project->mmc_path . '/' . $auk->auk_path . '/' . $auk->image_dir . '/' . $mmc->filename;
if(strcasecmp(substr($mmc->filename, -3, 3), 'svg') == 0 )
{
// $svg = file_get_contents($filePath);
// return response()->header('Content-Type', 'image/svg+xml')->file($filePath);
// file($filePath)->header('Content-Type', 'image/svg+xml');
}
else
{
return response()->file($filePath);
}
}
/**