create query builder laravel code example
Example 1: laravel db::query update
DB::table('user')->where('email', $userEmail)->update(array('member_type' => $plan));
Example 2: laravel 8 orderby
$flights = App\Models\Flight::where('active', 1)
->orderBy('name', 'desc')
->take(10)
->get();
Example 3: query builder laravel
use Illuminate\Database\Eloquent\Builder;
public function scopeFakePersons(Builder $query): Builder
{
return $query->where('is_fake', 1);
}