<td> {{ $item->salary }} </td>
@if($item['advance']['advance_salary'] == NULL )
<p>No Advance</p>
@else
{{ $item['advance']['advance_salary'] }}
@endif
</td>
<td>
@php
$amount = $item->salary - $item['advance']['advance_salary'];
@endphp
<strong style="color: #fff;"> {{ round($amount) }} </strong>
</td>
已尝试访问 null 类型值的数组偏移量运行这些命令
composer update php artisan cache:clear <br> php artisan config:clear<br> php artisan view:clear
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
在某些地方,您希望
$item是一个对象 ($item->salary),在其他地方,您将$item视为一个数组 ($item['advance']['advance_salary'])。 首先修复它们,在此过程中您可能会修复错误。