Eloquent: Expert Level

Do you know Eloquent well enough? Here are 10 questions to test it.
It's a small part of what is covered in my premium online-course Eloquent: Expert Level. For limited time, you can get -50% discount with code OFF50.

Answer these 10 questions. There's no time limit.

Question #1 Look at the code, we want to get the articles with title longer than 40 characters. What's behind XXXXXX? (the answer is one word)
Code snippet
$articles = Article::all()->XXXXXX(function($article) {
    return strlen($article->title) > 40;
});
Please fill in your answer

Question #2 Look at the code. You need to get all users ordered by days active DESCENDING. What would be behind XXXXX?
Code snippet
// In User model
public function getDaysActiveAttribute()
{
  return $this->created_at->diffInDays($this->updated_at);
}

// Controller code:
$users = User::all()->XXXXX('days_active');
Please fill in your answer

Question #3 Look at the code. What one letter should be instead of X, so that command would generate a migration, factory, and resource controller for the model?
Code snippet
php artisan make:model book -X
Please fill in your answer

Question #4 Look at the code - example of polymorphic relationship model. What's missing behind XXXXXX?
Code snippet
class Photo extends Model
{
    protected $fillable = ['photoable_id', 'photoable_type', 'filename'];

    public function photoable()
    {
        return $this->XXXXXX();
    }    

}
Please fill in your answer

Question #5 Look at the code. One author has many books, and one book may have many ratings. So what should be behind XXXXXX, if you want to get the authors with at least one rating for their book?
Code snippet
$authors = Author::XXXXXX('books.ratings')->get();
Please fill in your answer

Question #6 Look at the code. You want to have countries with many states, and states with many cities. And then you want to get all cities by certain countries. What's the word behind XXXXXX?
Code snippet
// Controller code
$countries = Country::with('cities')->get();

// Model code
class Country extends Model
{
    public function cities()
    {
        return $this->XXXXXX(City::class, State::class);
    }
}
Please fill in your answer

Question #7 Look at the code. What is the database table name that this model will work with, if you don't make any more changes in the model?
Code snippet
php artisan make:model Person
Please fill in your answer

Question #8 If you want to have $user->full_name attribute as accessor, merging "first_name" and "last_name" database columns, what should be the method name for that accessor in Eloquent Model?
Please fill in your answer

Question #9 Look at the code. What one word is method XXXXX, in order to select all users with IDs 1-4 and to select only 'name' column?
Code snippet
$users = User::XXXXX([1,2,3,4], ['name']);
Please fill in your answer

Question #10 Look at the code. What should be the method XXXXX, if the purpose of the query is to get all users registered in year 2018?
Code snippet
$users = User::XXXXX('created_at', 2018)->get();
Please fill in your answer