第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

顯示刀片文件時(shí)出現(xiàn)錯(cuò)誤 '' count(): 參數(shù)必須是實(shí)現(xiàn) Countable ''

顯示刀片文件時(shí)出現(xiàn)錯(cuò)誤 '' count(): 參數(shù)必須是實(shí)現(xiàn) Countable ''

PHP
吃雞游戲 2023-11-03 15:34:18
我在返回網(wǎng)站上的視圖時(shí)遇到問(wèn)題,我不斷收到此錯(cuò)誤ErrorExceptioncount(): Parameter must be an array or an object that implements Countable (View: C:\xampp\htdocs\cargo\resources\views\shipment\single.blade.php)這個(gè)錯(cuò)誤指向我的刀片文件中導(dǎo)致該錯(cuò)誤的部分,下面是我的視圖刀片文件 <div class="card" >    <div class="card-body ">        @if(count($shipment) >0)       @foreach($shipment as $shipment)                <div class="shipment-number">        <span class="title" style="display: block; font-size: 25px!important;">{{$shipment->tracking_code }}</span>    </div><!-- Track_Num --></div><br><br><div id="shipper-info" class="row" >        <div class="col-md-6 detail-section">            <p class="shipper details"><strong>Shipper's Information</strong></p>            <div class="shipper details">            <p><span class="label">Shipper Name : </span>{{$shipment->sender_name }}</p>            <p><span class="label">Phone Number : </span>{{$shipment->telephone }}</p>            <p><span class="label">Email : </span>{{$shipment->sender_email }}</p>            <p><span class="label">Address : </span>{{$shipment->sender_address }}</p>                    </div>    </div>            <div class="col-md-6 detail-section">            <p class="shipper details"><strong>Receiver's Information</strong></p>            <div class="receiver details">            <p><span class="label">Receiver Name : </span>{{$shipment->receiver_name }}</p>            <p><span class="label">Phone Number : </span>{{$shipment->receiver_telephone }}</p>            <p><span class="label">Address : </span>{{$shipment->receiver_address }}</p>            <p><span class="label">Email : </span>{{$shipment->receiver_email }}</p>                </div>    </div>        <div class="clear-line"></div></div>@endforeach@esle@endif并且錯(cuò)誤指向此部分@if(count($shipment) >0)       @foreach($shipment as $shipment)
查看完整描述

3 回答

?
開(kāi)心每一天1111

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超13個(gè)贊

您不需要對(duì)單個(gè)記錄應(yīng)用循環(huán),因?yàn)槟梢钥吹剿菃蝹€(gè)記錄。


<div class="card" >

        <div class="card-body ">

    

                <div class="shipment-number">

        <span class="title" style="display: block; font-size: 25px!important;">{{$shipment->tracking_code }}</span>

    </div><!-- Track_Num -->

</div>

<br><br>


<div id="shipper-info" class="row" >

        <div class="col-md-6 detail-section">

            <p class="shipper details"><strong>Shipper's Information</strong></p>

            <div class="shipper details">

            <p><span class="label">Shipper Name : </span>{{$shipment->sender_name }}</p>

            <p><span class="label">Phone Number : </span>{{$shipment->telephone }}</p>

            <p><span class="label">Email : </span>{{$shipment->sender_email }}</p>

            <p><span class="label">Address : </span>{{$shipment->sender_address }}</p>            

        </div>

    </div>

            <div class="col-md-6 detail-section">

            <p class="shipper details"><strong>Receiver's Information</strong></p>

            <div class="receiver details">

            <p><span class="label">Receiver Name : </span>{{$shipment->receiver_name }}</p>

            <p><span class="label">Phone Number : </span>{{$shipment->receiver_telephone }}</p>

            <p><span class="label">Address : </span>{{$shipment->receiver_address }}</p>

            <p><span class="label">Email : </span>{{$shipment->receiver_email }}</p>        

        </div>

    </div>

        <div class="clear-line"></div>

</div>


查看完整回答
反對(duì) 回復(fù) 2023-11-03
?
翻閱古今

TA貢獻(xiàn)1780條經(jīng)驗(yàn) 獲得超5個(gè)贊

您的調(diào)用->first()將返回一批貨件而不是一批貨件,您可以使用->get()->paginate()獲取模型的集合,然后在您的視圖中迭代它們。



查看完整回答
反對(duì) 回復(fù) 2023-11-03
?
忽然笑

TA貢獻(xiàn)1806條經(jīng)驗(yàn) 獲得超5個(gè)贊

獲取數(shù)據(jù)時(shí)刪除->first(),->get() or ->paginate(x)改為使用,這樣您就可以獲得集合。

在刀片文件中,foreach循環(huán)使用相同的變量作為集合和單個(gè)數(shù)據(jù)

@foreach($shipment as $shipment)

我建議您使用$shipments集合作為變量,并使用 $shipment 作為實(shí)例。

x 只是一個(gè)數(shù)字


查看完整回答
反對(duì) 回復(fù) 2023-11-03
  • 3 回答
  • 0 關(guān)注
  • 201 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)