Acesse o seu arquivo app/Providers/AppServiceProvider.php, e no método register adicione o seguinte :
/**
* Register any application services.
*
* @return void
*/| [ | |
| ["Acre", "AC"], | |
| ["Alagoas", "AL"], | |
| ["Amazonas", "AM"], | |
| ["Amapá", "AP"], | |
| ["Bahia", "BA"], | |
| ["Ceará", "CE"], | |
| ["Distrito Federal", "DF"], | |
| ["Espírito Santo", "ES"], | |
| ["Goiás", "GO"], |
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| php artisan tinker | |
| $tables = DB::select('SHOW TABLES'); | |
| $tables_in_database = "Tables_in_".Config::get('database.connections.mysql.database'); | |
| DB::statement('SET FOREIGN_KEY_CHECKS=0;'); | |
| foreach ($tables as $table) { | |
| Schema::drop($table->$tables_in_database); | |
| } |
| CREATE TABLE IF NOT EXISTS `municipios` ( | |
| `id` int(7) NOT NULL, | |
| `estado` varchar(19) COLLATE utf8_unicode_ci DEFAULT NULL, | |
| `uf` char(2) COLLATE utf8_unicode_ci DEFAULT NULL, | |
| `municipio` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL | |
| PRIMARY KEY (`id`) | |
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | |
| INSERT INTO `municipios` (`id`, `estado`, `uf`, `municipio`) VALUES | |
| (1100015, 'Rondônia', 'RO', 'Alta Floresta D\'Oeste'), |
| #!/bin/bash | |
| # Copyright (c) 2021 Soumya Deb <[email protected]> | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is | |
| # furnished to do so, subject to the following conditions: |