Skip to content

Instantly share code, notes, and snippets.

@Nickstr
Created May 4, 2012 10:26
Show Gist options
  • Save Nickstr/2593900 to your computer and use it in GitHub Desktop.
Save Nickstr/2593900 to your computer and use it in GitHub Desktop.
// Get Single news item
public function get_single($id, $slug = null)
{
// Get single news item
$news = news::single($id);
// Check if the news is protected and if the user is logged
if ($news->secure == 1 && !Auth::check())
{
// News is protected and user is not logged in
Return Redirect::to('gebruiker/inloggen');
} else {
// News is protected and user is logged in, continue to news item
Return View::make('front/news/single')->with('news', $news);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment