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
Post a Comment