public static function dumpTable($dbName, $tableName, $startAt, $rowsToGet, $filename) { // $filePath // if ($startAt == 0) { // } // $pdo = DB::connection()->getPdo(); // $query = $pdo->query("TRUNCATE TABLE `" . $dbName . "`.`" . $tableName . "`"); // return redirect('/manage-db/' . $dbName); var_dump(DBController::getTablesInDatabase($dbName)); }
Route::post('/settings', function () { return SettingController::displaySettingsIndex(); }); // DATABASE FUNCTIONS // database management Route::get('/manage-db/{dbName}', function ($dbName) { return DBController::fetchTablesForDatabase($dbName); }); Route::get('/drop-database/{dbName}', function ($dbName) { return DBController::dropDatabase($dbName); }); // table management Route::group(['prefix' => 'view-table'], function () { Route::get('{dbName}/{tableName}', function ($dbName, $tableName) { return DBController::viewTable($dbName, $tableName); }); }); Route::get('/truncate-table/{dbName}/{tableName}', function ($dbName, $tableName) { return DBController::truncateTable($dbName, $tableName); }); Route::get('/drop-table/{dbName}/{tableName}', function ($dbName, $tableName) { return DBController::dropTable($dbName, $tableName); }); Route::get('/dump-table/{dbName}/{tableName}/{startAt}/{rowsToGet}', function ($dbName, $tableName, $startAt, $rowsToGet) { return DBController::dumpTable($dbName, $tableName, $startAt, $rowsToGet); }); // ajax functions Route::post('/ajax/{requestName}', function ($requestName) { return AjaxController::$requestName(); }); });