Skip to content

Instantly share code, notes, and snippets.

@mattaebersold
Created March 31, 2014 18:18
Show Gist options
  • Save mattaebersold/9898718 to your computer and use it in GitHub Desktop.
Save mattaebersold/9898718 to your computer and use it in GitHub Desktop.
// 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::query()->orderBy(DB::raw('RAND()'))->visible()->take(1)->where('type', '=', 'youtube')->get(),
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment