Hi folks!
I'm having a struggle with a Route ( not sure if i'm doing it right, and yes for now i want that cPath = XX_XXX_X, as it represents multi-level categories, having slugs how i want it will go become to complex in the start-up of this project):
Route::get('/cPath={cPath?}', [IndexController::class, 'index'])->name('home');
If i do in my IndexController index():
public function index(Request $request)
{
$cPath = $request->key; //or any other option i read about
ddd($cPath);
...
I always get null or false.
if i do :
public function index($cPath)
{
ddd($cPath);
I get the desired value, but only in the controller, not in any other class where i require that paremeter..
What am i missing? and is the Route itself even correct?
I'm not sure, as i was hoping i could also use it for the main index, and only load specific other elements when the cPath is given with correct values. (3_17_26 for example)