@php $path = '/'.ltrim(request()->path(), '/'); if ($path === '') { $path = '/'; } $showAddPill = collect(['/transactions', '/budgets', '/goals', '/subscriptions', '/debts']) ->contains(fn ($p) => str_starts_with($path, $p)); $isSearchFab = collect(['/transactions', '/budgets', '/goals', '/subscriptions', '/debts']) ->contains(fn ($p) => str_starts_with($path, $p)); $addLabel = match (true) { str_starts_with($path, '/transactions') => __('budgets.mobile.add_transaction'), str_starts_with($path, '/budgets') => __('budgets.mobile.add_budget'), str_starts_with($path, '/goals') => __('budgets.mobile.add_goal'), str_starts_with($path, '/subscriptions') => __('budgets.mobile.add_subscription'), str_starts_with($path, '/debts') => __('budgets.mobile.add_debt'), default => __('budgets.mobile.generic_add'), }; @endphp @if ($showAddPill)
{{ $addLabel }}
@endif
@if ($isSearchFab) @else @endif