Or if you want to load it with the base query, you should use method `with`.
Here's an example:
$model_2 = Model2::query()
    ->where('name', $name)
    ->with('categories')
    ->get(); // Returns the Collection of Model2 with loaded relation of category