目前我正在使用Stripe作为我的支付网关,
我想要做的是根据环境切换键
在我的start.php中,我有以下设置
'local' => array('mymacpro'),
'production' => array('r2d2.mydomain.com')在stripe.php配置文件中是否可以像下面这样做。
if environment = local then use this key
else use this key任何帮助都将不胜感激。
干杯,
发布于 2014-08-05 00:33:11
只需遵循这里的说明,http://laravel.com/docs/configuration#environment-configuration为两个环境执行两个文件并将键放在那里。
比如app/config/stripe.php和app/config/local/stripe.php,哪些内容应该是
<?php
return [
'key' => 'KEY',
];然后在你的应用程序Config::get('stripe.key')做,它会自动切换。
https://stackoverflow.com/questions/25129507
复制相似问题