Level 54
I'm not so sure about this issue and package... but just feel that bootstrap/app.php seem not a good place to put plugin/package code inside... and some of the kernal functions may not ready if you put the sequence wrongly....
1 like
I'm trying to get opensoft/rollout to work and I've added this to my bootstrap/app.php
if(!function_exists('rollout'))
{
function rollout() : \Opensoft\Rollout\Rollout{
return app('Opensoft\Rollout\Rollout');
}
}
if(!function_exists('feature'))
{
function feature(string $feature) : bool {
return rollout()->isActive($feature, request()->user());
}
}
And in my app/Providers/AppServiceProvider.php I have
$this->app->singleton('rollout', function(){
$conn = DB::connection()->getPdo();
$rollout = new Rollout(new PDOStorageAdapter ($conn));
});
and in my artisan command I have
$feature = rollout()->isActive('testing');
dd($feature);
and what happens is when I run my artisan command I get this error
Target [Opensoft\Rollout\Storage\StorageInterface] is not instantiable while building [Opensoft\Rollout\Rollout].
Please or to participate in this conversation.