2021-10-30 12:16:27 +02:00
|
|
|
<?php namespace Zoomyboy\Social\Console;
|
|
|
|
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use Symfony\Component\Console\Input\InputArgument;
|
|
|
|
use Symfony\Component\Console\Input\InputOption;
|
|
|
|
use Zoomyboy\Social\Classes\InstagramService;
|
|
|
|
use Zoomyboy\Social\Models\Page;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SocialRefresh Command
|
|
|
|
*/
|
|
|
|
class SocialRefresh extends Command
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string name is the console command name
|
|
|
|
*/
|
|
|
|
protected $name = 'social:refresh';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string description is the console command description
|
|
|
|
*/
|
|
|
|
protected $description = 'refreshes keys for social instagram accounts';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* handle executes the console command
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
{
|
2021-10-30 13:32:09 +02:00
|
|
|
app(InstagramService::class)->pages()->each(function($page) {
|
|
|
|
app(InstagramService::class)->refresh($page);
|
2021-10-30 12:16:27 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* getArguments get the console command arguments
|
|
|
|
*/
|
|
|
|
protected function getArguments()
|
|
|
|
{
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* getOptions get the console command options
|
|
|
|
*/
|
|
|
|
protected function getOptions()
|
|
|
|
{
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
}
|