Laravel:如何通过api.php路线登录?

时间:2018-05-03 07:23:24

标签: php laravel

在下面的示例中,只有在发送请求的人员已获得授权的情况下,才必须从HTTP客户端通过http://example.loc/api/get_restricted_content/'请求从服务器检索json 0: "if you read this you has been authenticated"

Route::middleware('auth:api')->get('/get_restricted_content', function(){
  return response()->json("if you read this you has been authenticated");
});

我不知道如何实现它,但我想我们需要在get-parameter中发送电子邮件和密码。但由于Laravel的安全性,这绝对不够。我如何解决上述问题?

0 个答案:

没有答案