Update MicroCaching.php

This commit is contained in:
Irfan 2021-07-20 19:08:44 +05:00
parent 44f08a5886
commit 21535a403a

View File

@ -15,6 +15,7 @@ class MicroCaching
'RandomController@characters', 'RandomController@characters',
'RandomController@people', 'RandomController@people',
'RandomController@users', 'RandomController@users',
'InsightsController@main'
]; ];
/** /**
@ -26,10 +27,12 @@ class MicroCaching
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
$route = explode('\\', $request->route()[1]['uses']); if (isset($request->route()[1]['uses'])) {
$route = end($route); $route = explode('\\', $request->route()[1]['uses']);
if (\in_array($route, self::NO_CACHING)) { $route = end($route);
return $next($request); if (\in_array($route, self::NO_CACHING)) {
return $next($request);
}
} }
if ($request->header('auth') === env('APP_KEY')) { if ($request->header('auth') === env('APP_KEY')) {