I'm trying to perform a Curl method into a Laravel console command, but I'm getting ReflectionException
. I've already tried composer update && composer dump-autoload
but the problem persists.
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
and that you have
'Curl' => Ixudra\Curl\Facades\Curl::class,
in your config/app.php aliases array
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.