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>
- 1 回答
- 0 關注
- 165 瀏覽
添加回答
舉報