Using config() inside Artisan
futdev opened this issue · 2 comments
futdev commented
I read on here that it's not possible to use by default the Config::get('setting here')
command with Artisan, so inside my Command Class, I've done the following:
use Backpack\Settings;
/**
* Create a new command instance.
*
* @return void
*/
public function __construct() {
Settings::init();
parent::__construct();
};
public function handle() {
$this->info(Config::get('settings.program_status'));
}
But I'm getting this error thrown inside the console:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Backpack\Settings' not found
How can I go about fixing this?
lloy0076 commented
It's complaining, for some reason, that PHP cannot resolve that class; is it in your composer.json
?
Besides, if it's not possible to use the config get command within Artisan, I'm not sure how this is meant to work anyway.