Files
mtdb_movie/app/Console/Commands/UpdateSeasonsFromRemote.php
T
maher 511fad8199
Build / run (push) Has been cancelled
Initial commit
2026-05-14 13:42:10 +02:00

28 lines
605 B
PHP
Executable File

<?php
namespace App\Console\Commands;
use App\Models\Season;
use Illuminate\Console\Command;
class UpdateSeasonsFromRemote extends Command
{
protected $signature = 'seasons:update';
public function handle(): void
{
$seasons = Season::orderBy('updated_at', 'asc')
->with('title')
->limit(50)
->get();
$this->withProgressBar($seasons, function (Season $season) {
if ($season->title) {
$season->maybeUpdateFromExternal($season->title);
}
});
$this->info('Seasons updated');
}
}