How to access a property value inside JsonResponse Object in PHP or Laravel?

前端 未结 3 1900
迷失自我
迷失自我 2021-01-12 19:46

I\'m doing a POST using Ajax and my Server is getting the data just fine. However, I\'m struggling to access the value the user sent. In simple words how can I access the va

3条回答
  •  暖寄归人
    2021-01-12 20:24

    With Laravel you can access to JSON data same way as regular variables. In your case you need something like:

    $username = $request->get('user');
    

提交回复
热议问题