CacheClear.php 795B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Http\Middleware;
  3. use Closure;
  4. use App\Common\Api;
  5. class CacheClear
  6. {
  7. /**
  8. * Handle an incoming request.
  9. *
  10. * @param \Illuminate\Http\Request $request
  11. * @param \Closure $next
  12. * @return mixed
  13. */
  14. public function handle($request, Closure $next)
  15. {
  16. $response = $next($request);
  17. $params = $request->all();
  18. if(isset($params['activity_id'])){
  19. $questions_cache = env('WEB_URL').'/brainstorming/console/cache/question?activity_id='.$params['activity_id'];
  20. $config_cache = env('WEB_URL').'/brainstorming/console/cache/config?activity_id='.$params['activity_id'];
  21. Api::curl($config_cache);
  22. Api::curl($questions_cache);
  23. }
  24. return $response;
  25. }
  26. }