Created
July 18, 2017 12:33
-
-
Save isurum/e9d7c471b7057b639ebed6acfe78795f to your computer and use it in GitHub Desktop.
Laravel 5.4 Bootstrap row class for every 3 columns - Blade Template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@foreach($products->chunk(3) as $items) | |
<div class="row"> | |
@foreach($items as $item) | |
<div class="col-md-4 portfolio-item"> | |
<a href="#"> | |
<img class="img-responsive" src="{{ 'uploads/'.$item->product_image_url }}" alt=""> | |
</a> | |
<h3> | |
<a href="/view-product-details/{{ $item->id }}">{{ $item->product_name }}</a> | |
</h3> | |
<p>{{ str_limit($item->product_description, 121) }}</p> | |
</div> | |
@endforeach | |
</div> | |
@endforeach |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function showProducts(){ | |
$products = DB::table('products')->paginate(9); | |
return view('products', ['products' => $products]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment