2021_03_17_041036_add_aff_code_config.php 428 B

12345678910111213141516171819202122
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. class AddAffCodeConfig extends Migration
  4. {
  5. protected $newConfigs = [
  6. 'aff_salt',
  7. ];
  8. public function up()
  9. {
  10. foreach ($this->newConfigs as $config) {
  11. \App\Models\Config::insert(['name' => $config]);
  12. }
  13. }
  14. public function down()
  15. {
  16. \App\Models\Config::whereIn('name', $this->newConfigs)->delete();
  17. }
  18. }