In app\Exceptions\handler.php, add below:

if($e instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException)
    {
        // some code
    }