Argument 1 passed to must be an instance of Illuminate\\Database\\Eloquent\\Builder, instance of Illuminate\\Database\\Eloquent\\Relations\\HasMany given code example
Example: Argument 1 passed to Illuminate\\Database\\Eloquent\\Builder::__construct() must be an instance of Illuminate\\Database\\Query\\Builder, instance of Illuminate\\Database\\Eloquent\\Builder given
$model->relation()->getQuery()