Following is the routing code I am using in my script:-
Route::any('/set-status/{id}/{status}', [ 'as'=>'admin_service_category_set_status',
'uses'=>'Admin\ServiceCategoryController@set_status'])
->where(array('id'=> '[0-9]+', 'status' => '[a-z]+');
Here, the script checks whether the 'status' contains alphabets or not. I want it to check whether status is either 'activate' or 'deactivate'. How can I do that?
You just need set: 'status' => 'activate|deactivate'
Route::any('/set-status/{id}/{status}', [
'as'=>'admin_service_category_set_status',
'uses'=>'Admin\ServiceCategoryController@set_status'])-
>where(array('id'=> '[0-9]+', 'status' => 'activate|deactivate'));