jeudi 29 juillet 2021

Convert observer to array in vuejs

I am processing in laravel.

$product = Product::selectRaw('name')->groupBy('name')->get();
return response()->json($product);

Result :

(69) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, __ob__: Observer]
0: {__ob__: Observer}
1: {__ob__: Observer}
2: {__ob__: Observer}
3: {__ob__: Observer}
4: {__ob__: Observer}
5: {__ob__: Observer}

Now i want it like this:

item: Array(69)
[0 … 69]
0: {…}
1: {…}
2: {…}
3: {…}

Give me an idea..Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire