{{-- Package banners that were icons in the old top bar (partials/header-right), same conditions (#2957). Pages that show them (Start, Ditt konto, Skapa utskick) include this in @section('banners'); pass $only to limit which, e.g. ['sendoutLimit'] on Skapa utskick. --}} @php $nhShow = $only ?? ['upgrade', 'unpaidInvoice', 'sendoutLimit']; $nhCompany = Auth::user()->company; $nhPackage = $nhCompany->package; $nhFree = $nhPackage->monthly_cost == 0; @endphp {{-- Accounts with an expiry date already have the shared free-period banner and its upgrade CTA. --}} @if (in_array('upgrade', $nhShow, true) && $nhFree && is_null($nhCompany->expire_date))
@endif @if (in_array('unpaidInvoice', $nhShow, true) && ! $nhFree && $nhCompany->invoices()->unpaid()->count() > 0) @endif @if (in_array('sendoutLimit', $nhShow, true) && $nhPackage->max_email_sendouts > 0) @php $nhUsage = $nhCompany->currentMonthSendouts()['usage_percent']; @endphp @if ($nhUsage >= 90) @endif @endif