lundi 25 février 2019

How to format json data in laravel?

I need to format this data in html and css and get ride of the json format and show only text.

Displayed data:

{"id":"<h3>...............................................<h3><br \\> 
<h1>rzNC35gDNG6moR3w<h1>"}

Controller:

function requete()
{
    $id = Str::random();
    $res = '<h3>...............................................<h3>'
        ."<br \><h1>".$id.'<h1>';
    return response()->json(['id' => $res]);
}

View:

$(document).ready(function() {   
     $.ajax({
            url:"",                              
     });
});



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire