When there is no controller action , then it can be checked as
if(! method_exists($controller, $action)) {
return 404;
}
But when there is no Controller, I am getting this error
Illuminate\Contracts\Container\BindingResolutionException
Target class [\App\Http\Controllers\DashboardController] does not exist.
But, is it possible to show a custom 404 blade page instead?