Description
SELECT * FROM `galleries` WHERE `galleries`.`products_id` = 1 AND `galleries`.`products_id` IS NOT NULL limit 1
View Code
<div class="container">
<div class="row pt120">
<div class="books-grid">
<div class="row mb30">
@if (count($products) > 0)
@foreach ($products as $product)
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<div class="books-item">
<div class="books-item-thumb">
@if ($product->gallery)
<img src="{{ asset('assets/site/img/'. $product->gallery->image ) }} " alt="book">
@endif
<div class="new">New</div>
<div class="sale">Sale</div>
<div class="overlay overlay-books"></div>
</div>
I think defined your foreign key with a different name, if it isn't id so specify it in the model.
~~~
protected $primaryKey = 'Your_primary_ID';
~~~
If it's not the case, reach back to us again using post comments with more details. You can also update the post content to share more detail with us. Thank you
0 Likes 3 Comments
Sonam Ojha
SELECT * FROM `galleries` WHERE `galleries`.`product_id` = 1 AND `galleries`.`product_id` IS NOT NULL LIMIT 1; it's looking like you unknown column 'galleries.products_id' in the WHERE clause of your SQL query. you should check your sql structure
Hadayat Niazi Super Admin
wajahat Author
can you please share the screen with me whenever you have time please tell me I want to learn more but get stuck here ??
Good job dear.