File manager - Edit - /var/www/html/transparencia/database/seeders/RollbackImportIncentivosCulturaisSeeder.php
Back
<?php namespace Database\Seeders; use App\Models\IncentivoCultural; use Illuminate\Database\Seeder; use Illuminate\Support\Facades\DB; class RollbackImportIncentivosCulturaisSeeder extends Seeder { public function run(): void { DB::beginTransaction(); try { $total = IncentivoCultural::query()->count(); IncentivoCultural::query()->delete(); DB::commit(); $this->command?->info('Rollback de importação de Incentivos Culturais concluído.'); $this->command?->line("incentivos_culturais removidos: {$total}"); } catch (\Throwable $e) { DB::rollBack(); $this->command?->error('Erro no rollback de Incentivos Culturais: '.$e->getMessage()); throw $e; } } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings