title: orWhereHas not existing laravel Eloquent php 7.4
body: <p>Here is my Macro for relation search in  Laravel Eloquent.
  Bellow is my Macro in AppServiceProvider.php</p>
  <pre><code>    Builder::macro('whereLike', function ($attributes, string $searchTerm) {
          $this-&gt;where(function (Builder $query) use ($attributes, $searchTerm) {
              foreach (Arr::wrap($attributes) as $attribute) {
                  $query-&gt;when(
                      str_contains($attribute, '.'),
                      function (Builder $query) use ($attribute, $searchTerm) {
                          [$relationName, $relationAttribute] = explode('.', $attribute);
  
                          $query-&gt;orWhereHas($relationName, function (Builder $query) use 
                      ($relationAttribute, $searchTerm) {
                              $query-&gt;where($relationAttribute, 'LIKE', &quot;%{$searchTerm}%&quot;);
                          });
                      },
                      function (Builder $query) use ($attribute, $searchTerm) {
                          $query-&gt;orWhere($attribute, 'LIKE', &quot;%{$searchTerm}%&quot;);
                      }
                  );
              }
          });
  
          return $this;
      });
  </code></pre>
  <p>Bellow is my search Query in MemberController.php</p>
  <pre><code> public function getMembers(request $request){
  
   $members = Member::with('products')-&gt;where('groupId', 1)-&gt;whereLike(['firstname', 
     'lastname', 'products.name'], $request-&gt;searchValue)-&gt;paginate(10);
  dd($members);
  }
  </code></pre>
  <p>The &quot;whereLike&quot; is invoked from the appServiceProvider.php as a macro in there thus where the error occur if i remove the <code>members.name</code> the macro executes perfectly.</p>
  <p>I get an Error with orWhereHas</p>
  <p>&quot;Call to undefined method Illuminate\Database\Query\Builder::orWhereHas()&quot;</p>