php - laravel return to view instead of 500

one text

So i am creating a multi roll laravel website. there you can view posts depending on your role. for example, a 'partner' can view all posts with the id: 1,2,6 in my controller i have a function that checks if this is true. since you can alter the link http://localhost:8000/partner/posts{postid}.

now whenever i do http://localhost:8000/partner/posts{post id that does not exist}.

i get a 500 server error. but how can i just return the user to a specific view instead of this 500 server error

Source