With custom development come a lot of entry points for users. This snippet throws access denied for users that are too curious on some paths.

use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;

if(!$contest->isActive()) {
  throw new AccessDeniedHttpException();
}

 


Saved you some valuable time?

Donate and get more free time-saving code on this website in the future.