Skip to content

Instantly share code, notes, and snippets.

@weotch
Forked from mattaebersold/gist:9898718
Last active August 29, 2015 13:57
Show Gist options
  • Save weotch/9898776 to your computer and use it in GitHub Desktop.
Save weotch/9898776 to your computer and use it in GitHub Desktop.
<?php
// Homepage feed
public function index($filter = null) {
// Tell Laravel where to find the mustache views for post
app('view')->addNamespace('js', public_path().'/js');
// Render the view
$this->layout->nest('content', 'gadget.index', array(
'posts' => Post::filter($filter)->ordered()->visible()->take(self::PER_PAGE)->where('type', '=', 'youtube')->get(),
'filters' => Filter::ordered()->get(),
'featured' => Post::randomize()->visible()->where('type', '=', 'youtube')->first(),
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment