G
G
GrimJack2017-05-07 16:13:58
Laravel
GrimJack, 2017-05-07 16:13:58

How to get variable from route in lumen(laravel)?

I made this route in laravel:

Route::get('/{category}', '[email protected]');

And then in the controller
public function categories(Request $request){
        dd($request->all());
    }

Everything worked fine and the $category variable was displayed.
But not so in lumens. Route similarly:
$app->get('/{category}', '[email protected]');

And the same controller outputs emptiness. Any attempt to find this variable is futile. However, if you just dd($request) and search the page, such a key=>value exists.
How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav, 2017-05-07
@mzcoding

public function categories($category){
        dd($category);
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question