Answer the question
In order to leave comments, you need to log in
MiddleWare example in Laravel for handling UTM tags?
Please explain how to "get" to arbitrary parameters in the http request in order to be able to process them. For example, if a person goes to a page via a link with utm_tags, they need to be saved (to the session, cookies, or somewhere else) and redirect the person to the same page, but without parameters.
Those. I want to somehow get what is in $_REQUEST. We are talking about Laravel 5.3.
Here it is - throws out everything in general:
<?php
namespace App\Http\Middleware;
use Closure;
use Symfony\Component\HttpFoundation\ParameterBag;
class CheckParams
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$params = $request->route()->parameters();
print_r($params);
return $next($request);
}
}
Answer the question
In order to leave comments, you need to log in
Everything is quite simple, you can use if to make a condition that for such and such a parameter, give such and such a cookie and that's it.
https://nginx.ru/ru/docs/http/ngx_http_rewrite_mod...
https://nginx.ru/ru/docs/http/ngx_http_core_module...
nginx.org/ru/docs/http/ngx_http_userid_module.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question