 22d3bb4036
			
		
	
	22d3bb4036
	
	
	
		
			
			Added probe.php Added new installer views and controllers Updated AuthController Updated Middlewares Updated Commands for installation process
		
			
				
	
	
		
			57 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			57 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Console\Commands;
 | |
| 
 | |
| use DB;
 | |
| use Illuminate\Console\Command;
 | |
| 
 | |
| class DropTables extends Command
 | |
| {
 | |
|     /**
 | |
|      * The name and signature of the console command.
 | |
|      *
 | |
|      * @var string
 | |
|      */
 | |
|     protected $signature = 'droptables';
 | |
| 
 | |
|     /**
 | |
|      * The console command description.
 | |
|      *
 | |
|      * @var string
 | |
|      */
 | |
|     protected $description = 'Drops all tables';
 | |
| 
 | |
|     /**
 | |
|      * Create a new command instance.
 | |
|      *
 | |
|      * @return void
 | |
|      */
 | |
|     public function __construct()
 | |
|     {
 | |
|         parent::__construct();
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * Execute the console command.
 | |
|      *
 | |
|      * @return mixed
 | |
|      */
 | |
|     public function handle()
 | |
|     {
 | |
|         $colname = 'Tables_in_'.env('DB_DATABASE');
 | |
| 
 | |
|         $droplist = \Schema::getConnection()->getDoctrineSchemaManager()->listTableNames();
 | |
|         $droplist = implode(',', $droplist);
 | |
| 
 | |
|         DB::beginTransaction();
 | |
|         //turn off referential integrity
 | |
|         DB::statement('SET FOREIGN_KEY_CHECKS = 0');
 | |
|         DB::statement("DROP TABLE $droplist");
 | |
|         //turn referential integrity back on
 | |
|         DB::statement('SET FOREIGN_KEY_CHECKS = 1');
 | |
|         DB::commit();
 | |
| 
 | |
|         $this->comment(PHP_EOL.'If no errors showed up, all tables were dropped'.PHP_EOL);
 | |
|     }
 | |
| }
 |