コード例 #1
0
@if($petitions->isEmpty())
<p>No Active Petitions</p>
@else
<table class="table table-condensed">
	<thead>
		<tr>
			<th>Class Name</th>
			<th>Signees</th>
			<th>Subject</th>
		</tr>
	</thead>
	<tbody>
		@foreach($petitions as $petition)
		<?php 
$signee = Signee::where('petition_id', '=', $petition->id);
?>
		<tr>
			<td>{{ $petition->class_name }}</td>
			<td>{{ $signee->count() }}</td>
			<td>{{ $petition->subject }}</td>
			<td>
				<a href="{{ action('PetitionController@showPetition', $petition->id) }}" 
					class="btn btn-default">View</a>
			@if(Auth::user() -> role == 'Admin')
				<a href="{{ action('PetitionController@handleDeletePetition', $petition->id) }}" class="btn btn-danger">Delete</a>
			@endif
			</td>
		</tr>
		@endforeach
	</tbody>