jonnybarnes.uk/app/Console/Commands/ReDownloadWebMentions.php

49 lines
1,013 B
PHP
Raw Normal View History

<?php
namespace App\Console\Commands;
2017-12-19 16:00:42 +00:00
use App\Models\WebMention;
use Illuminate\Console\Command;
use App\Jobs\DownloadWebMention;
class ReDownloadWebMentions extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'webmentions:redownload';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Redownload the HTML content of webmentions';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$webmentions = WebMention::all();
foreach ($webmentions as $webmention) {
2016-09-19 21:22:03 +01:00
$this->info('Initiation re-download of ' . $webmention->source);
2016-09-20 13:13:05 +01:00
dispatch(new DownloadWebMention($webmention->source));
}
}
}