[英]ReflectionException Laravel Console Command
I'm trying to perform a Curl method into a Laravel console command, but I'm getting ReflectionException
. 我试图在Laravel控制台命令中执行Curl方法,但是却遇到了ReflectionException
。 I've already tried composer update && composer dump-autoload
but the problem persists. 我已经尝试过composer update && composer dump-autoload
但问题仍然存在。
My code is like: 我的代码是这样的:
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Ixudra\Curl\Facades\Curl;
class IndexOrders extends Command
{
protected $signature = 'my:command';
protected $description = 'Description';
public function __construct()
{
parent::__construct();
}
public function handle()
{
Curl::doSomething();
}
}
You can't use the facade directly, you need to ensure that you have 您不能直接使用外墙,需要确保
Ixudra\Curl\CurlServiceProvider::class,
in your config/app.php providers array 在您的config / app.php提供者数组中
and that you have 而且你有
'Curl' => Ixudra\Curl\Facades\Curl::class,
in your config/app.php aliases array 在您的config / app.php别名数组中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.