javascript - Remove " from json using laravel -
hello wanted know how use blade variable in javascript. here query in laravel
$users=json_encode(db::table('ledger')->select('name','openingbalance')->get());
i'm trying access in javascript file shown below
var users ="{{ $users }}";
and output shown below:
[ {"name":"harsh","openingbalance":"5755.00"}, {"name":"harh","openingbalance":"-12000.00"}, {"name":"gfgfhgf","openingbalance":"-333.00"} ]
i wanted know how remove " perfect json use.
you're escaping data {{ }}
automatically in laravel 5. use {!! $users !!}
instead.
Comments
Post a Comment