I want to make this, 1. Controller return json data to 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 will make decode this data and will use.
{{ $data2 = @json_decode($data) }}
{{ var_dump($data2) }}
json data going into view but don't decoding on array.
How can decode this data?
Response::jsonis meant to be the actual response returned by the controller (see laravel.com/docs/4.2/responses#special-responses), instead you have passed that response through to the view as data. It might help to clarify why you are using the json encoding step, instead of$data = array('status' => FALSE, 'code' => 205, 'message' => 'Deneme', 'data' => null), 200 );and then{{ var_dump($data) }}.