Skip to content

Instantly share code, notes, and snippets.

@coreymcmahon
Last active August 29, 2015 14:14
Show Gist options
  • Save coreymcmahon/43bdd8523779d2bb95bd to your computer and use it in GitHub Desktop.
Save coreymcmahon/43bdd8523779d2bb95bd to your computer and use it in GitHub Desktop.
admin/products/index.php - A Pattern for Reusable Resource Controllers in Laravel 4.2 http://slashnode.com/reusable-resource-controllers/
@extends('layouts.master')
@section('title', 'Products')
@section('content')
<h2>Products</h2>
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th></th>
</tr>
</thead>
<tbody>
@if (count($items))
@foreach($items as $item)
@include('admin.products.row', ['item' => $item])
@endforeach
@else
<tr class="text-muted center">
<td colspan="3">(No products to display)</td>
</tr>
@endif
</tbody>
</table>
<div>
{{ $items->links() }}
</div>
<div>
<a href="{{ route('admin.products.create') }}" class="btn btn-success pull-right">
<span class="fa fa-plus"> </span> Create Product
</a>
</div>
@stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment