Backup MySQL tables in Laravel without third-party libraries
Backup MySQL tables in Laravel without third-party libraries I new to Laravel. I've been trying to create a controller that backups tables in the form of backup_date_.sql format without using any third-party library at all, but I'm getting frustrated. I've searched and I found some code examples. I've tried to use them within my BackupsController, but things are getting more and more difficult. Any help is really appreciated. This is my code, Thanks in advance. <?php public function query($data, $mode = PDO::FETCH_ASSOC) { $pdo = DB::connection()->getPdo(); $stmt = $pdo->query($data); $results = $stmt->fetchAll($mode); // $results = $stmt->fetch($mode); return $results; } public function backup(Request $request) { if ($request->all()) { $output = ''; foreach (request('table') as $table) { $show_table_query = $this->query("SHOW CREATE TABLE " . stripslashes($table) . "...