1234567891011121314151617181920212223242526272829303132333435 |
- <?php
-
- namespace App\Http\Middleware;
-
- use Closure;
- use App\Common\Api;
-
- class CacheClear
- {
- /**
- * Handle an incoming request.
- *
- * @param \Illuminate\Http\Request $request
- * @param \Closure $next
- * @return mixed
- */
- public function handle($request, Closure $next)
- {
- $response = $next($request);
-
- $params = $request->all();
-
- if(isset($params['activity_id'])){
-
- $questions_cache = env('WEB_URL').'/brainstorming/console/cache/question?activity_id='.$params['activity_id'];
- $config_cache = env('WEB_URL').'/brainstorming/console/cache/config?activity_id='.$params['activity_id'];
-
- Api::curl($config_cache);
- Api::curl($questions_cache);
- }
-
- return $response;
- }
- }
|