Complete the code to retrieve all users using Eloquent.
$users = User::[1]();The all() method retrieves all records from the users table as Eloquent models.
Complete the code to find a user by their primary key using Eloquent.
$user = User::[1](1);
The find() method retrieves a model by its primary key, simplifying the query.
Fix the error in the code to create and save a new user with Eloquent.
$user = new User; $user->name = 'Alice'; $user->email = 'alice@example.com'; $user->[1]();
The save() method saves the model instance to the database. 'insert' and 'create' are different methods, and 'update' is for existing records.
Fill both blanks to get users whose age is greater than 18 using Eloquent.
$adults = User::where('[1]', '[2]', 18)->get();
The where method filters users where the 'age' column is greater than 18.
Fill all three blanks to create a dictionary of user emails and names for users older than 25.
$result = User::where('[1]', '[2]', 25)->pluck('[3]', 'email');
This code gets a list of user names keyed by their email for users older than 25.