@extends('layouts.portal') @section('title', 'Pay for Edit Access') @section('page_title', 'Pay for Edit Access') @section('page_subtitle', 'Complete payment to enable editing') @section('sidebar') @include('client.partials.sidebar', ['active' => 'profile']) @endsection @php // Get selected sections $selectedSections = []; if ($editRequest->section_type === 'multi' && $editRequest->sections_json) { $selectedSections = is_array($editRequest->sections_json) ? $editRequest->sections_json : (json_decode($editRequest->sections_json, true) ?? []); } elseif ($editRequest->section_type !== 'multi') { $selectedSections = [$editRequest->section_type]; } // Map section to details $sectionDetails = [ 'beneficiaries' => [ 'name' => 'Beneficiaries', 'icon' => 'heart', 'color' => 'orange', 'package_code' => 'UPDATE_BENEFICIARIES', 'price' => 150, ], 'assets' => [ 'name' => 'Assets & Allocations', 'icon' => 'briefcase', 'color' => 'cyan', 'package_code' => 'UPDATE_ASSETS', 'price' => 150, ], 'liabilities' => [ 'name' => 'Liabilities', 'icon' => 'credit-card', 'color' => 'rose', 'package_code' => 'UPDATE_LIABILITIES', 'price' => 150, ], 'executors' => [ 'name' => 'Executors', 'icon' => 'user-tie', 'color' => 'teal', 'package_code' => 'UPDATE_EXECUTORS', 'price' => 150, ], 'allowances' => [ 'name' => 'Allowances', 'icon' => 'receipt', 'color' => 'amber', 'package_code' => 'UPDATE_ALLOWANCES', 'price' => 150, ], 'gifts' => [ 'name' => 'Gifts & Donations', 'icon' => 'gift', 'color' => 'pink', 'package_code' => 'UPDATE_GIFTS', 'price' => 150, ], ]; // Get packages for each selected section $packagesToPay = collect(); foreach ($selectedSections as $section) { if (isset($sectionDetails[$section])) { $details = $sectionDetails[$section]; $pkg = \App\Models\Package::where('is_active', true) ->where('code', $details['package_code']) ->first(); if ($pkg) { $packagesToPay->push($pkg); } } } $totalPrice = $packagesToPay->sum('price'); $primaryColor = isset($sectionDetails[$selectedSections[0]]) ? $sectionDetails[$selectedSections[0]]['color'] : 'blue'; @endphp @section('content')
You have selected {{ count($selectedSections) }} section(s) to edit. Complete the payment to unlock editing.
Your edit access is now active for the following sections:
{{ $name }}
@endforeach