laravel-orion
laravel-orion copied to clipboard
How to define a catch-all route
I have pages as my model. and i am binding it via,
Orion::resource('pages', PageController::class)->where(['page', '([0-9A-Za-z/\s-]*)'])->only(['index', 'show']);
above does work for single routes like /api/pages/about
but it doesn't work for nested routes. /api/pages/about/faq
I know laravel has any route so i can do it that way but orion doesn't have that. i even tried,
Orion::resource('pages/about', PageController::class)->only(['show']);
but this tries to find faq model so not sure how i can achieve that with orion. tried going through docs but nothing on documentation as well.
@GautierDele can you help me with this
Hi @hardikdangar,
Might be a typo in your regex - escape the \ character: ([0-9A-Za-z\/\s-]*)
https://regex101.com/r/lxLz6P/1

