Something like:
PromotedAccount::query()
->select('promoted_accounts.*')
->join('promoted_account_plans as pap', 'pap.id', '=', 'promoted_accounts.promoted_account_plan_id')
->where('pap.target', '>=', function (Builder $query) {
$query->selectRaw('count(`id`)')
->from('promoted_account_histories')
->whereColumn('promoted_account_histories.promoted_account_id', 'promoted_accounts.id')
->limit(1)
});