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 关注
- 119 浏览
添加回答
举报