N
N
Nik Gubin2016-09-01 05:29:27
Laravel
Nik Gubin, 2016-09-01 05:29:27

How to get an array with keys in Laravel through the DB facade, in which the values ​​of the desired uniques. fields?

Goodnight.
I can add to the title of the question only that I write the request not through the builder, but with my hands: In the same Kohana, it was possible to solve my question like this:
DB::select("select..", ['foo' => 'bar'])

Database::instance()->query(Database::SELECT, $sql, true)->as_array('id');

Thanks to! :-)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2016-09-01
@gubin_niko

https://laravel.com/docs/5.3/queries#retrieving-results

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question