You can include this in your app\Exception\Handler.php
file's render
method:
if($e instanceof InvalidArgumentException) abort(404);
Don't forget to use InvalidArgumentException;
at the top of class.
EDIT: I can see this is a general Exception and lots of classes throwing it. So when some other class throws this Exception, you will still get 404.
So just a quick hack:
if(($e instanceof InvalidArgumentException) && str_contains($e->getFile(), 'Illuminate/View/FileViewFinder')) abort(404);
So this will only show 404 when FileViewFinder file throws InvalidArgumentException.
P.S May be there are better solution.