<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class PushConfigData extends Migration
{
  /**
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
    $data = [[
      'label' => 'Logo',
      'value' => '/storage/assets/logo.png',
      'type' => '2',
    ], [
      'label' => 'Favicon',
      'value' => '/storage/assets/favicon.png',
      'type' => '2',
    ], [
      'label' => 'Login欢迎图片',
      'value' => '/storage/assets/login_image.jpg',
      'type' => '2',
    ], [
      'label' => '网站名称',
      'value' => env('APP_NAME'),
      'type' => '1',
    ]];
    foreach ($data as $datum) {
      $config = new App\Models\Config();
      $config->label = $datum['label'];
      $config->value = $datum['value'];
      $config->type = $datum['type'];
      $config->remark = '';
      $config->save();
    }
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
    //
  }
}
