I got this data from request in Laravel
{"value":"QWS Welding Supply Solutions, Taylor Street","latitude":-27.4495148,"longitude":153.0696076}
but i am not able to access keys individually i.e value, latitude, longitude. I have tried json_decode but that's not working.
This is my controller method
public function saveLocation(Request $request){
$location = $request->all();
Location::create(['address'=>$location->value,'long'=>$location->longitude,'lat'=>$location->latitude]);
}
basically i want to save location data from request to database. in the $location object i got data that i pasted on top
Location::create(['address'=>$request->value,'long'=>$request->longitude,'lat'=>$request->latitude]);