A
A
Alexey Verkhovtsev2018-02-02 18:09:49
Laravel
Alexey Verkhovtsev, 2018-02-02 18:09:49

Is it possible to somehow pass a dynamic parameter from the address bar to the laravel middleware?

Hello everyone, we can pass the {param} parameter to the controller in this way, but is it possible to pass a non-static middle:static string to the middleware, as well as dynamically from the request url, or how to do it at all? The task is this, there are requests to the server from a client like server.com/log/psap and there are a lot of such requests and I would like to fasten the middleware so that before each request the "psap" parameter is checked or not, if not, then we reject if "psap", then you can continue
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2018-02-02
@JhaoDa

It looks like you haven’t read the documentation and haven’t looked at how other middleware works. Middleware already has access to the request object, why should she pass something?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question