Skip to main content
Laravel Code Completion Medium +20 XP

Eloquent Where

Complete the query to find active users.

LaravelFill in the blank
$users = User::___("active", true)->get();

Type the missing code

Show answer and explanation

Answer: where

where() adds a WHERE clause to the Eloquent query. ->get() executes it and returns a Collection.

Hint: Which method adds a condition to an Eloquent query?

What this challenge tests

Code Completion in Laravel: eloquent, queries.

Related challenges