İlk temizlik tamamlandı bir önceki projeden

This commit is contained in:
Ümit Tunç
2026-04-28 21:14:25 +03:00
commit f80443aec0
10000 changed files with 959965 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\File;
class MigrateFromDate extends Command
{
protected $signature = 'migrate:from-date {date}';
protected $description = 'Migrate migrations from a specific date';
public function __construct()
{
parent::__construct();
}
public function handle()
{
$date = $this->argument('date');
$migrationsPath = database_path('migrations');
$migrations = File::files($migrationsPath);
foreach ($migrations as $migration) {
$migrationDate = substr($migration->getFilename(), 0, 10); // YYYY_MM_DD kısmını alır
if ($migrationDate > $date) {
Artisan::call('migrate', ['--path' => 'database/migrations/' . $migration->getFilename()]);
$this->info('Migrated: ' . $migration->getFilename());
}
}
}
}