diff --git a/app/Http/Controllers/PublicController.php b/app/Http/Controllers/PublicController.php index b7aa1d5..33702a7 100644 --- a/app/Http/Controllers/PublicController.php +++ b/app/Http/Controllers/PublicController.php @@ -39,6 +39,13 @@ class PublicController extends BaseController } public function returnImageFile($tenant, $gallery, $image, Request $request) { + $image = Image::query()->where("id", "=", $image)->firstOrFail(); + $size = $request->input("size", "medium"); + $file = Storage::disk($image->driver)->response($image->path); + return $file; + } + + public function returnImageFile2($tenant, $gallery, $image, Request $request) { $uid = uniqid(); Log::info($uid.": Start", [$image]); $globalstart = microtime(true); diff --git a/app/Http/Middleware/LogMiddleware.php b/app/Http/Middleware/LogMiddleware.php new file mode 100644 index 0000000..6d3fa97 --- /dev/null +++ b/app/Http/Middleware/LogMiddleware.php @@ -0,0 +1,27 @@ + microtime(true)]); + $r = $next($request); + Log::info("Request end", ["time" => microtime(true)]); + return $r; + } +} diff --git a/app/Log.php b/app/Log.php new file mode 100644 index 0000000..009bc75 --- /dev/null +++ b/app/Log.php @@ -0,0 +1,26 @@ +getHandlers(); + foreach ($handlers as $handler) { + /*$handler->setFormatter(new LogstashFormatter('log', basename($handler->getUrl()))); + $handler->pushProcessor(new FieldsProcessor()); + $handler->pushProcessor(new WebProcessor()); + $handler->pushProcessor(new IntrospectionProcessor()); + $handler->pushProcessor(new GuardProcessor()); + $handler->pushProcessor(new QueryBindingsProcessor()); + $handler->pushProcessor(new HeadersProcessor()); + $handler->pushProcessor(new BadResponseGuzzleProcessor()); + + */ + $handler->pushProcessor(new UidProcessor()); + } + } +}