Blog

HomeLaravelLaravel remove &quot from json

Laravel remove &quot from json

When getting data in json

$users = User::all()->json();

In blade template using the data

var users = {{ $users }}

It will return error because the encoding will get code likeĀ &quot

Escaping the data with {{ }} automatically in Laravel 5. Use {!! $users !!} instead.

Written by

The author didnt add any Information to his profile yet