I have a route like the following :
Route::group([
'prefix' => 'reports'
], function () {
Route::get('/points/{product_name}', ['uses' => 'MyController@get'])->where('product_name', ['product1', 'product2','product3'])
});
So I would like to limit the access to this endpoint id the product name is product1
, product2
, product3
. But with the where
clause, I can only see checking with regular expression or a single value.
When I use an array like ['product1', 'product2', 'product3']
, but it is throwing an error "message": "Routing requirement for "product_name" must be a string."
How can I solve this?