Created
February 23, 2016 19:11
-
-
Save anonymous/3483a12216013170db19 to your computer and use it in GitHub Desktop.
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
Route::get('guidelines/{slug}/{page}', ['as' => 'guideline-page', function($slug, $page) { | |
$guideline = Guideline::findBySlugOrFail($slug); | |
$page = $guideline->guidelineBlocks()->where('slug', $page)->firstOrFail(); | |
// previous pages | |
$previous = GuidelineBlock::where('guideline_blocks.guideline_id', '=', $guideline->id) | |
->where('guideline_blocks.id', '!=', $page->id) | |
->orderBy('guideline_blocks.position', 'asc') | |
->first(); | |
echo $previous->title; | |
//print_r($previous); | |
die; | |
return layout('coma.guideline-page', [ | |
'guideline' => $guideline, | |
'page' => $page, | |
]); | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment