belongsTo(MerchantUser::class); } public function scopeType($query) { $type = request()->type; return $query->where('type', $type); } }