亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

試圖獲取非對象的屬性“image_two”

試圖獲取非對象的屬性“image_two”

PHP
天涯盡頭無女友 2023-03-04 17:06:24
我已經使用他們的設置將 pgadmin 連接到 heroku 數據庫。我的遷移也通過 postres 遷移工具成功但應用程序沒有顯示錯誤,但在成功部署的本地主機上一切正常。當我從表中獲取行數據時,即使在遷移之后,它也不會在 postgres pgadmin 中顯示任何數據網址: https: //agile-stream-57638.herokuapp.com/錯誤(3/3) ErrorExceptionTrying to get property 'image_two' of non-object (View: /app/resources/views/layouts/slider.blade.php) (View: /app/resources/views/layouts/slider.blade.php)滑塊.blade.php    <!-- Banner -->    @php        $slider = DB::table('products')                ->join('brands','products.brand_id','brands.id')                ->select('products.*','brands.brand_name')                ->where('main_slider',1)->orderBy('id','DESC')                ->first();    @endphp    <div class="banner">        <div class="banner_background" style="background-image:url({{ asset('public/frontend/images/banner_background.jpg')}})"></div>        <div class="container fill_height">            <div class="row fill_height">                <div class="banner_product_image"><img src="{{ asset($slider->image_two )}}" alt=""                    style="height: 300px;"></div>                <div class="col-lg-5 offset-lg-4 fill_height">                    <div class="banner_content">                        <h1 class="banner_text">{{ $slider->product_name }} </h1>                        <div class="banner_price">                            @if($slider->discount_price == Null)                                <h2>{{ $slider->selling_price }} </h2>                            @else                                <span>{{ $slider->selling_price }}</span>{{ $slider->discount_price }}</div>                            @endif                        <div class="banner_product_name">{{ $slider->brand_name }}</div>                        <div class="button banner_button"><a href="#">Shop Now</a></div>                    </div>                </div>            </div>        </div>    </div>
查看完整描述

1 回答

?
搖曳的薔薇

TA貢獻1793條經驗 獲得超6個贊

我已經使用他們的設置將 pgadmin 連接到 heroku 數據庫。我的遷移也通過 postres 遷移工具成功但應用程序沒有顯示錯誤,但在成功部署的本地主機上一切正常。當我從表中獲取行數據時,即使在遷移之后,它也不會在 postgres pgadmin 中顯示任何數據


網址: https: //agile-stream-57638.herokuapp.com/


錯誤


(3/3) ErrorException

Trying to get property 'image_two' of non-object (View: /app/resources/views/layouts/slider.blade.php) (View: /app/resources/views/layouts/slider.blade.php)

滑塊.blade.php


    <!-- Banner -->

    @php

        $slider = DB::table('products')

                ->join('brands','products.brand_id','brands.id')

                ->select('products.*','brands.brand_name')

                ->where('main_slider',1)->orderBy('id','DESC')

                ->first();


    @endphp


    <div class="banner">

        <div class="banner_background" style="background-image:url({{ asset('public/frontend/images/banner_background.jpg')}})"></div>

        <div class="container fill_height">

            <div class="row fill_height">

                <div class="banner_product_image"><img src="{{ asset($slider->image_two )}}" alt=""

                    style="height: 300px;"></div>

                <div class="col-lg-5 offset-lg-4 fill_height">

                    <div class="banner_content">

                        <h1 class="banner_text">{{ $slider->product_name }} </h1>

                        <div class="banner_price">

                            @if($slider->discount_price == Null)

                                <h2>{{ $slider->selling_price }} </h2>

                            @else

                                <span>{{ $slider->selling_price }}</span>{{ $slider->discount_price }}</div>

                            @endif



                        <div class="banner_product_name">{{ $slider->brand_name }}</div>

                        <div class="button banner_button"><a href="#">Shop Now</a></div>

                    </div>

                </div>

            </div>

        </div>

    </div>


查看完整回答
反對 回復 2023-03-04
  • 1 回答
  • 0 關注
  • 165 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號