LARAVEL 一些小知識點

1.配置未找到404錯誤

App\Exceptions\Handler  render 方法里加入

if (!($exception instanceof AuthenticationException)) {        
            return response()->json([
                    'errorinfo' => ['c_err'=>'Resource not found.','err_data'=>123,'err_code' => 404]
            ],404);  
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章