The abort function throws an HTTP exception which will be rendered by the exception handler:
<?php abort(403);
<?php     public function ensureLocalEnvironment()

    {

        if (! app()->environment('local')) {

            abort(403, "Runnable solutions are disabled in non-local environments. Please make sure `APP_ENV` is set correctly. Additionally please make sure `APP_DEBUG` is set to false on ANY production environment!");

        }

    }
<?php         );



        if ($ipIsPublic) {

            abort(403, "Solutions can only be executed by requests from a local IP address. Please also make sure `APP_DEBUG` is set to false on ANY production environment.");

        }

    }

}
<?php         try {

            return $shareReportAction->handle(json_decode($request->get('report'), true), $request->get('tabs'), $request->get('lineSelection'));

        } catch (UnableToShareErrorException $exception) {

            abort(500, 'Unable to share the error '.$exception->getMessage());

        }

    }

}
<?php     public function handle(Request $request, Closure $next, string $value)

    {

        if (! $this->ignitionConfig->toArray()[$value]) {

            abort(404);

        }



        return $next($request);
<?php     public function handle($request, Closure $next)

    {

        if (! $this->ignitionEnabled()) {

            abort(404);

        }



        return $next($request);
<?php         $solution = $this->getSolution();



        if (! $solution instanceof RunnableSolution) {

            abort(404, 'Runnable solution could not be found');

        }



        return $solution;