Last active
March 13, 2016 19:05
-
-
Save matthewtrask/a1219fad185f972d17b1 to your computer and use it in GitHub Desktop.
This file contains 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
@extends('layout.master') | |
@section('title', 'Classes') | |
@section('content') | |
<h2>Classes</h2> | |
@foreach($classes as $class) | |
<div class="panel" id="classes"> | |
<h3>{{$class->class_name}}</h3> | |
<p>{{$class->teaser}}</p><hr> | |
<div class="row"> | |
<div class="small-7 columns"> | |
{{$class->description}} | |
</div> | |
<div class="small-5 columns" id="classDetails"> | |
<ul> | |
<li>{{$class->ages}}</li> | |
<li>{{$class->day}}</li> | |
<li>{{$class->time}}</li> | |
<li>{{$class->price}}</li> | |
</ul> | |
<button class="button register"><a href="{{$class->link or 'Email Us'}}">Register</a></button> | |
</div> | |
</div> | |
</div> | |
@endforeach | |
<ul class="pagination"> | |
{{$paginate->render()}} | |
</ul> | |
@endsection |
This file contains 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
<?php | |
namespace App\Http\Controllers\Obct; | |
use App\Classes; | |
use Illuminate\Pagination\Paginator; | |
use App\CurrentShow; | |
use App\Http\Controllers\Controller; | |
class ClassesController extends Controller | |
{ | |
public function classes() | |
{ | |
$classes = Classes::paginate(5); | |
$currentShow = CurrentShow::all(); | |
$paginator = new Paginator($classes, count($classes), 5); | |
return view('obct.classes', | |
[ | |
'classes' => $classes, | |
'currentShow' => $currentShow, | |
'paginate' => $paginator | |
] | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment