Hello guys,
I have this Route defitinion:
Route::get('packages/{package}', ['uses' => 'ProductsController@package', 'as' => 'products.packages']);
And now I need different URL which will use same controller with exact {package} defined.
Something like this:
Route::get('/some/path', ['uses' => 'ProductsController@package', 'package' => 'PACK_ID']);
How can I pass PACK_ID to controller without defining it in URL.
I know I can just call another controller method, which will call package method ($this->package($PACK_ID)), but i'm trying to do this in the shortest path.
BTW, sorry for my english.
You'd need to perhaps store it in the session or somewhere outside of the route, you won't be able to pass it directly into the controller method from a route.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community