public function search($search, $per_page)
	{
		$per_page = is_numeric($per_page) ? $per_page : 5;

		return Post::with(array('tags', 'user'))
			->select('posts.*')
			->join('tags', 'posts.id', '=', 'tags.post_id')
			->where(function($query) use ($search)
			{
				$query->orWhere('title', 'like', '%'.$search.'%')
							->orWhere('content', 'like', '%'.$search.'%');
			})
			->orderBy('posts.publish_date', 'desc')
			->where('posts.active', '=', 1)
			->where('posts.publish_date', '<=', new DateTime)
			->groupBy('id')
			->distinct()
			->paginate($per_page);
	}