Skip to main content
Laravel Output Prediction Easy +10 XP

Eloquent All

What does this return?

LaravelRead-only
$users = User::all();

What is the output?

Show answer and explanation

Answer: Collection of all users

::all() returns an Eloquent Collection containing all records from the users table.

Hint: all() fetches every record.

What this challenge tests

Output Prediction in Laravel: eloquent, collections.

Related challenges