路线
Route::get('attendence/{year?}/{name?}/{category?}, 'EmployeesController@users');
控制器动作
function users($year=null, $name=null, $category= null){
}
我的要求不是抛出异常,而是为以下所有URL向用户显示有意义的消息。
http://localhost:8080/2012/john/travel
http://localhost:8080/undefined/john/travel
http://localhost:8080/undefined/john
http://localhost:8080/john
换句话说,应验证变量年份的数值、名称和字母类别。
不适用:
我用的是Laravel Lumen
感谢您的任何帮助