php - Laravel, response json data into controller and make json_decode into view -


i want make this, 1. controller return json data view

$data =  response::json(array('status' => false, 'code' => 205, 'message' => 'deneme', 'data' => null), 200 );      return view::make('site.index.index')->with('data', $data); 

2. view make decode data , use.

{{ $data2 = @json_decode($data)  }}  {{ var_dump($data2) }} 

json data going view don't decoding on array.

how can decode data?

$data = json_encode(array('status' => false, 'code' => 205, 'message' => 'deneme', 'data' => null));  return view::make('site.index.index')->with('data', $data); 

Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -