Laravel-Backpack/Settings

Using config() inside Artisan

futdev opened this issue · 2 comments

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?

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.

PR ready - #70
Let's move the conversation there, please.