dimanche 28 mai 2017

Two column values in same table Laravel 5.4 merge into Array

I want to merge example_1 and example_2 values into array.

example_1 and example_2 are of type int.

User::select('example_1','example_2')->where('id',Auth::user()->id)->get();
// The result: [{"example_1":"1","example_2":"2"}]

example_1 and example_2 if has value 1 and 2 respectively.

I want to have an array : [1,2]



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire