Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

skiab0x's avatar

How to get more than one value from a Database query?

Hello guys. I have created the following db query using the Laravel DB Facade :

DB::table('currencies')->whereNull('spot_price')->value('shortcode');

The problem with the query above is that I only get one value (for example 'ABC') and I have two records in my table that match these specific criteria. Any ideas on how to get multiple values back?

Thank you very much!

0 likes
1 reply
MichalOravec's avatar
Level 75
DB::table('currencies')->select('shortcode')->whereNull('spot_price')->get();

Please or to participate in this conversation.