dijkr / Copia

Laravel-project with CMS
0 stars 0 forks source link

Function to show a product #5

Closed dijkr closed 1 year ago

dijkr commented 1 year ago

Define the function at the ProductController and use this route: Route::get('/{product:slug}', [ProductController::class, 'showProduct']); In this case the function would be called showProduct.

dijkr commented 1 year ago

Solution: Route::get('/product/{product:slug}', [ProductController::class, 'showProduct']); Because just ('/{product:slug} will match other routes too. Using /product/{..} creates a unique route.