Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

viewSinglePost fails when a post is unpublished #66

Open
bagdaddy opened this issue Jan 14, 2022 · 0 comments
Open

viewSinglePost fails when a post is unpublished #66

bagdaddy opened this issue Jan 14, 2022 · 0 comments

Comments

@bagdaddy
Copy link

When I unpublish a post and try to access it via url, the code breaks on
$categories = $blogPost->post->categories()->with([ 'categoryTranslations' => function ($query) use ($request) { $query->where("lang_id", '=', $request->get("lang_id")); } ])->get();
because $blogPost->post is null. Would be nice if this was handled and an exception was thrown or a 404 page was returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants