After much tinkering, I've come up with a way to access config data via Illuminate\Support\Facades\Config
This uses some code from the existing Config example and uses a container (using kint just for dumping):
<?PHP
use Illuminate\Support\Facades\Config;
use Illuminate\Container\Container;
use Illuminate\Config\Repository;
$config = new Repository(require(FILE_ROOT . "/config/app.php"));
$app = new Container();
$app->instance(
'config',
$config
);
Illuminate\Support\Facades\Facade::setFacadeApplication($app);
s($app->get('config')->get("app"));
s(Config::get('app'));
Output:
Current example uses a slim app, so is incompatible with the above. Would it make sense to add a separate file like "components/config/example2.php" (for instance)?
EDIT: This may tie in some how to PR #191 ... but maybe not.
After much tinkering, I've come up with a way to access config data via
Illuminate\Support\Facades\Config
This uses some code from the existing Config example and uses a container (using kint just for dumping):
Output:
Current example uses a slim app, so is incompatible with the above. Would it make sense to add a separate file like "components/config/example2.php" (for instance)?
EDIT: This may tie in some how to PR #191 ... but maybe not.