Laravel.io
public function getPost($id, $slug = false)
    {
    	$post = Post::find($id);

    	if ($post) {
    		if ($post->slug != $slug || !$slug) {
    			return Redirect::route('post', array('id' => $post->id, 'slug' => $post->slug), 303);
    		}

    		if ($post->active == false) {
    			return redirect('/')->withErrors('requested page not found');
    		}
    	} else {
    		return redirect('/')->withErrors('requested page not found');
    	}

    	return view('posts.show')->withPost($post);
    }

Please note that all pasted data is publicly available.