S
S
SM_ST2020-12-24 15:49:27
Laravel
SM_ST, 2020-12-24 15:49:27

How to write to the user's cache?

in Controller.php I check for the presence of a partner id and if I find it, I cache it, but for some reason it is entered into the site's global cache

public function __construct()
  {
    $this->middleware(function ($request, $next) {
      if($request->has('utm')) Cache::put('partner_id', trim(htmlspecialchars((int)$request->utm)), now()->addYear());
      return $next($request);
    });
  }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question