C
C
Caspanch2017-03-06 18:09:19
Laravel
Caspanch, 2017-03-06 18:09:19

How to set paths correctly?

You need to configure the view paths (laravel 5.3):
/products/obuv
/products/odezhda/anoraki
/products/obuv/krosi
/products/obuv/krosi/adidas
/products/odezhda/kurtki/zimnie/detskie
(examples just to show nesting)
Nesting can be any, it is not clear what to write in routes.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cha-cha, 2017-03-06
@Caspanch

Route::get('/products/{categories?}', function($categories = null){
    return explode('/', $categories);
})->where('categories', '.*');

result:
["odezhda","kurtki","zimnie","detskie"]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question