argument('video')); if (! $video) { $this->error("Video {$this->argument('video')} not found."); return 1; } if ($video->type !== 'match' || ! $video->sportsMatch) { $this->error("Video {$video->id} is not a match with a sports record."); return 1; } $controller = new VideoController(); $r = new \ReflectionMethod($controller, 'renderMatchOgImage'); $r->setAccessible(true); $png = $r->invoke($controller, $video); if ($png === null) { $this->error("Render failed. See laravel.log."); return 1; } $this->info("Rendered " . strlen($png) . " bytes for video {$video->id}."); return 0; } }