mardi 26 décembre 2017

Lararel Object to Array

I try for some time to use an array instead of a collection, as laravel does.

I tried to do this method, without success:

Event::listen(StatementPrepared::class, function ($event) {
    $event->statement->setFetchMode(...);
});

As explained on http://ift.tt/2jrxKqS, but it's not working...

I also tried to do this:

DB::table('users')->where([...])->take(1)->get()->toArray();

But it's doing:

Array ( [0] => stdClass Object ( [uid] => 1 [...]) )

I know there is more about it on the forum, but they are all outdated.

Thanks



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2BSAxV0
via IFTTT

Aucun commentaire:

Enregistrer un commentaire