oc-social-plugin/console/SocialRefresh.php

50 lines
1.1 KiB
PHP
Raw Normal View History

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()
{
Page::get()->each(function($account) {
app(InstagramService::class)->refresh($account);
});
}
/**
* getArguments get the console command arguments
*/
protected function getArguments()
{
return [];
}
/**
* getOptions get the console command options
*/
protected function getOptions()
{
return [];
}
}