Use regex
route::post('InspectionChecks/List/{type}', 'InspectionChecksController@index')->where('type', '^(ASSET|TRAILER)$');
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
route::post('InspectionChecks/List/{type}', 'InspectionChecksController@index');
In above route, i want type to be either ASSETor TRAILER. How can we achieve it without going to the controller ?
Use regex
route::post('InspectionChecks/List/{type}', 'InspectionChecksController@index')->where('type', '^(ASSET|TRAILER)$');
Please or to participate in this conversation.