38 lines
788 B
PHP
38 lines
788 B
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: Marco Glietsch
|
|
* Date: 07.12.2018
|
|
* Time: 14:15
|
|
*/
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Helpers\PublishHelper;
|
|
use Illuminate\Console\Command;
|
|
|
|
class PublishSocialMedia extends command
|
|
{
|
|
protected $signature = 'publish:social-media {--testRun=false} {--daysInFuture=0}';
|
|
|
|
protected $description = 'Veröffentlicht Posts in den sozialen Netzwerken';
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public function handle()
|
|
{
|
|
$daysInFuture = $this->option('daysInFuture');
|
|
$testRun = $this->option('testRun');
|
|
if(strtoupper($testRun) == 'TRUE')
|
|
{
|
|
$testRun = true;
|
|
}
|
|
else{
|
|
$testRun = false;
|
|
}
|
|
PublishHelper::publishTodayPosts(['facebook', 'twitter'], $testRun, $daysInFuture);
|
|
}
|
|
} |