Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

websvb's avatar

Parameter from url in resource

/resources/shop?shop=1 -Hello. why is this shop parameter not available through the request in the resource? how to get it in the nova resource?

0 likes
4 replies
vincent15000's avatar

You should follow some courses on Laravel.

Here on Laracast, you have very good series to learn Laravel from scratch.

websvb's avatar

I am walking through. I also read the documentation. Laravel Nova doesn't say anything about passing parameters from url. I'm trying to pass them to the resource, but they are not in request or in global variables. the only thing is that the server has a url. and all. Of course I can parse it. but it's a pity that it's impossible to work with the resource in terms of passing parameters from the url

kokoshneta's avatar
Level 27

@websvb You can type-hint the request into any controller method in Nova just as in Laravel in general, and then the parameter should be available under $request->query('shop').

But it sounds like you’re trying to do something that’s a bad idea to begin with. What do you mean you want to get a URL parameter in the resource? Query parameters are business logic and belong in the controller layer, not in the model layer.

If you’re defining a PostResource to reflect posts, how are you intending a query parameter from the URL of the page the user is visiting to interact with any given post or its related resource?

1 like
websvb's avatar

@kokoshneta yes, there is a resource/page page and different content can be shown on it, depending on the parameters in the url. resource/page?param=1,2,3 etc. because the content is displayed using the standard functionality of the Laravel Nova resource. but I don't need a lot of resources, so I decided to create one and show dynamic data on it

Please or to participate in this conversation.