Files
sibedas/app/Console/Commands/TruncatePBGTable.php
2025-08-07 22:04:40 +07:00

41 lines
874 B
PHP

<?php
namespace App\Console\Commands;
use App\Models\PbgTask;
use App\Models\PbgTaskAttachment;
use App\Models\PbgTaskDetail;
use App\Models\PbgTaskRetributions;
use DB;
use Illuminate\Console\Command;
class TruncatePBGTable extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:truncate-pbg-table';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Execute the console command.
*/
public function handle()
{
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
PbgTask::truncate();
PbgTaskAttachment::truncate();
PbgTaskRetributions::truncate();
PbgTaskDetail::truncate();
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
}
}