Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

Again you miss the point because you didn't read the doc carefully.

$query = DB::table('whatever');

if(whatever){
  $query->where('whatever', '=', $value);
}

if(whatever){
  $query->where('whatever', '=' $value);
}

$results = $query->get();

Try to figure things out by yourself before jumping on the forum, and dont delete your posts when it get solved, it might be useful for other people.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Sharping sharping Joined 28 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.