added numbers to regex for products and categories route
This commit is contained in:
parent
c57c5d9b6f
commit
e57cd8e552
|
|
@ -62,7 +62,7 @@ class ProductsCategoriesProxyController extends Controller
|
|||
{
|
||||
$slug = rtrim($slug, '/ ');
|
||||
|
||||
if (preg_match('/^([a-z-]+\/?)+$/', $slug)) {
|
||||
if (preg_match('/^([a-z0-9-]+\/?)+$/', $slug)) {
|
||||
|
||||
if (DB::table(app(CategoryTranslation::class)->getTable())
|
||||
->where('url_path', '=', $slug)
|
||||
|
|
@ -84,9 +84,8 @@ class ProductsCategoriesProxyController extends Controller
|
|||
|
||||
return view($this->_config['product_view'], compact('product', 'customer'));
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
abort(404);
|
||||
}
|
||||
}
|
||||
|
|
@ -302,7 +302,7 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function
|
|||
'product_view' => 'shop::products.view',
|
||||
'category_view' => 'shop::products.index'
|
||||
])
|
||||
->where('slug', '^([a-z-]+\/?)+$')
|
||||
->where('slug', '^([a-z0-9-]+\/?)+$')
|
||||
->name('shop.productOrCategory.index');
|
||||
|
||||
Route::fallback('Webkul\Shop\Http\Controllers\HomeController@notFound');
|
||||
|
|
|
|||
Loading…
Reference in New Issue