简体   繁体   English

从Laravel PHP中的JSON请求获取价值

[英]Get Value from JSON Request in Laravel PHP

I get a response in my routes.php, this response is a JSON, this is my code: 我在routes.php中收到响应,此响应是JSON,这是我的代码:

Route::post('/prueba', function(){
     if(Request::ajax()){    
    echo Response::json(Request::all());       
    }
 });

When I make an echo from this I get all this in my console: 当我对此做出回应时,我将在控制台中获得所有这些信息:

在此处输入图片说明

What I need to get just the value from auction_price for example? 例如,我仅需要从Auction_price中获取价值?

try this 尝试这个

Route::post('/prueba', function(){
 if(Request::ajax()){    
echo Response::json(Request::get('auction_price'));       
}
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM