0
Laravel 5.2請求驗證在丁格(JWT)API中不起作用。Laravel 5.2請求驗證與Dingo(JWT)Api
當我嘗試調用控制器方法時,我使用了請求驗證,以確定它返回吹動錯誤的時間。
錯誤 { 「消息」: 「500內部服務器錯誤」, 「STATUS_CODE」:500}
控制器
請求
namespace App\Http\Requests;
use App\Http\Requests\Request;
class StoreBlogPost extends Request {
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize() {
return False;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules() {
return [
'FloorKey' => 'required',
];
}
public function response(array $error) {
//Can't get json responce validation error in Controller
return response()->json(['error' => $error], 422);
}
}
你能告訴我們你到現在爲止做了什麼嗎? –
@RahulSharma這是我的代碼。 –