Laravel 5.8:为 foreach() 提供的参数无效

Laravel 5.8: Invalid argument supplied for foreach()

我有一个叫 user_wallet 的 table,像这样:

所以每个 wallet_id 代表 wallets 的一个钱包 table:

现在我试图显示一些结果,例如 wallet name 和 wallet balance 像这样:

@php
$us_id = Auth()->user()->usr_id;
$user_wallet = App\UserWallet::where('user_id', $us_id)->get();

foreach($user_wallet as $uw){
    $wallet_info = App\Wallet::find($uw->id);
    foreach($wallet_info as $wf){
        @endphp
        <ul style="list-style:none">
            <li>
                <div class="form-check">
                    <input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault1">
                    <label class="form-check-label small mr-3" for="defaultCheck2">
                        {{ $uw->balance }} - {{ wf->name }}
                    </label>
                </div>
            </li>
        </ul>
        @php
    }
}
@endphp

但是我得到这个错误:

为 foreach() 提供的参数无效

它指的是这一行:

那到底出了什么问题?我该如何解决这个问题?

这一行:$wallet_info = App\Wallet::find($uw->id); 给你 1 个你不能在 foreach 中使用的对象

你可以使用这样的东西:

App\Wallet::where('id',$uw->id)->get();