This commit is contained in:
hackerESQ
2024-08-30 21:58:38 -05:00
parent 2a42ce9d12
commit d6cf867c6d
13 changed files with 361 additions and 122 deletions
+50
View File
@@ -0,0 +1,50 @@
<?php
namespace App\Console\Commands;
use App\Models\Holding;
use Illuminate\Console\Command;
class SyncHoldingData extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'holding-data:refresh';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Refresh holdings';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
// get all holdings
$holdings = Holding::get();
foreach ($holdings as $holding) {
$this->line('Refreshing ' . $holding->symbol);
$holding->syncTransactionsAndDividends();
}
}
}