php - How to pack laravel request with my own variables in middleware for later use? -


i found can like

$request->merge(['aplika' => 5]);

or

$request->request->add(['aplika' => 5]);

but goes request + query in request.

and there can later problem when working model or request form.

i found can other way , put in attributes like:

$request->attributes->add(['aplika' => 5]);

and goes attributes

image showing this

but how later read in controller?

how this?

maybe there other way in can pack request in middleware in variables not used validation / model things other purpose?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -