mardi 23 octobre 2018

How to allow route parameter to use / or - in laravel 5.5

For a sample link,

https://ddskart.com/product/COPIER%20TONER/NP-6/7/8000/71

How do I construct a GET route ?

the route must follow the given format.

Route::get('product/{category}/{model}/{product_id}', function ($category, $model, $product_id) {
    // do whatever ...
});

where the parameters could be

$category   = 'COPIER TONER';
$model   = 'NP-6/6/7/8000'; 
$product_id = 71;



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire