[Bug] Error when firing request from artisan command
ortix opened this issue · 1 comments
ortix commented
I created an artisan command which has to fire some API POST requests. The problem is this block in Hmvc.php
// Masking route to allow testing with PHPUnit.
if ( ! $originalRoute instanceof Route)
{
$originalRoute = new Route(new \Symfony\Component\HttpFoundation\Request());
}
It throws:
Missing argument 2 for Illuminate\Routing\Route::__construct(), called in /var/www/animekyun/vendor/teepluss/hmvc/src/Teepluss/Hmvc/Hmvc.php on line 91 and defined
This is my fire method in the command:
public function fire()
{
$torrent = $this->argument('torrent');
$url = $this->argument('url');
$request = HMVC::post('api/episode', array('filename' => $torrent, 'url' => $url));
dd($request);
File::append(base_path() . '/test.txt', basename($torrent) . "\n");
File::append(base_path() . '/test.txt', $url . "\n\n");
Log::info('Call from Flexget', ['context' => 'File: ' . $torrent]);
}
For now I have removed that code block
tony-was commented
I am getting the same issue here. is there a fix for this?