@extends('admin.layouts.app') @section('title', get_setting('site_name').' | '.__('Salary Setup')) @section('content') @php $decodePresets = function ($key) { $raw = get_setting($key); if (! is_string($raw)) { return []; } $a = json_decode($raw, true); return is_array($a) ? $a : []; }; $presetAllowances = $decodePresets('salary_allowance_presets'); $presetDeductions = $decodePresets('salary_deduction_presets'); $allowRows = old('custom_allowances'); if (! is_array($allowRows) || count($allowRows) === 0) { $allowRows = [['label' => '', 'amount' => '']]; } $dedRows = old('custom_deductions'); if (! is_array($dedRows) || count($dedRows) === 0) { $dedRows = [['label' => '', 'amount' => '']]; } $structureEnabled = \App\Services\SalaryStructureService::enabled(); @endphp