This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
david.armstrong16347
I am trying to call App:abort(404) during a boot hook in my custom service provider, but when i call it the following error occurs:
Undefined Symfony\Component\HttpKernel\Exception\NotFoundHttpException in /backend/vendor/laravel/framework/src/Illuminate/Foundation/Application.php line 901
Any guidance on how to resolve this would be appreciated.
david.armstrong16347
If it helps, here is sudo code of what i want to achieve:
<?php
namespace MyPlugin;
use App;
use October\Rain\Support\ModuleServiceProvider;
use Request;
use Redirect;
class ServiceProvider extends ModuleServiceProvider
{
public function boot()
{
// Check user can access site.
if ($this->userHasAccess() === FALSE)
{
App::abort(403);
}
// Check if hidden from user.
if ($this->hiddenFromUser() === TRUE)
{
App::abort(404);
}
}
}
Both calls to App::abort()
trigger the error. It seems like Symfony\Component\HttpKernel\Exception\NotFoundHttpException
is not being auto loaded correctly.
1-2 of 2