SiteSwitchSeeder.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. use Illuminate\Database\Seeder;
  3. use Illuminate\Support\Facades\DB;
  4. class SiteSwitchSeeder extends Seeder
  5. {
  6. /**
  7. * Run the database seeds.
  8. *
  9. * @return void
  10. */
  11. public function run()
  12. {
  13. DB::table('switch')->insert([
  14. 'name' => 'adsense',
  15. 'status' => 0,
  16. 'extra' => '{"script": ""}',
  17. 'created_at' => 1553745930,
  18. 'updated_at' => 1553745930,
  19. ]);
  20. DB::table('switch')->insert([
  21. 'name' => "counter",
  22. 'status' => 0,
  23. 'extra' => '{"script": ""}',
  24. 'created_at' => 1553745930,
  25. 'updated_at' => 1553745930,
  26. ]);
  27. DB::table('switch')->insert([
  28. 'name' => "baidu_autopush",
  29. 'status' => 0,
  30. 'extra' => '',
  31. 'created_at' => 1553745930,
  32. 'updated_at' => 1553745930,
  33. ]);
  34. DB::table('switch')->insert([
  35. 'name' => "motto",
  36. 'status' => 1,
  37. 'extra' => json_encode(
  38. [
  39. "title" => "联系作者",
  40. "content" => "微信: luvvien 添加注明: vienblog.com"
  41. ], JSON_UNESCAPED_UNICODE),
  42. 'created_at' => 1553745930,
  43. 'updated_at' => 1553745930,
  44. ]);
  45. DB::table('switch')->insert([
  46. 'name' => "tag",
  47. 'status' => 1,
  48. 'extra' => json_encode(
  49. [
  50. "title" => "标签",
  51. "count" => 30
  52. ], JSON_UNESCAPED_UNICODE),
  53. 'created_at' => 1553745930,
  54. 'updated_at' => 1553745930,
  55. ]);
  56. DB::table('switch')->insert([
  57. 'name' => "category",
  58. 'status' => 1,
  59. 'extra' => json_encode(
  60. [
  61. "title" => "分类",
  62. "count" => 20
  63. ], JSON_UNESCAPED_UNICODE),
  64. 'created_at' => 1553745930,
  65. 'updated_at' => 1553745930,
  66. ]);
  67. DB::table('switch')->insert([
  68. 'name' => "hot",
  69. 'status' => 1,
  70. 'extra' => json_encode(
  71. [
  72. "title" => "热门文章",
  73. "count" => 8
  74. ], JSON_UNESCAPED_UNICODE),
  75. 'created_at' => 1553745930,
  76. 'updated_at' => 1553745930,
  77. ]);
  78. DB::table('switch')->insert([
  79. 'name' => "latest",
  80. 'status' => 1,
  81. 'extra' => json_encode(
  82. [
  83. "title" => "刚刚发布了",
  84. "count" => 8
  85. ], JSON_UNESCAPED_UNICODE),
  86. 'created_at' => 1553745930,
  87. 'updated_at' => 1553745930,
  88. ]);
  89. DB::table('switch')->insert([
  90. 'name' => "popular",
  91. 'status' => 1,
  92. 'extra' => json_encode(
  93. [
  94. "title" => "最近有人在看",
  95. "count" => 8
  96. ], JSON_UNESCAPED_UNICODE),
  97. 'created_at' => 1553745930,
  98. 'updated_at' => 1553745930,
  99. ]);
  100. DB::table('switch')->insert([
  101. 'name' => "carousel",
  102. 'status' => 1,
  103. 'extra' => json_encode([ // 设置滚动的Banner 请让图的长宽比都相同 否则切换时高度会变化
  104. [
  105. "image" => "/images/banners/vultr_affiliate_560x260.png", // 图片路径
  106. "url" => "https://www.vultr.com/?ref=8372175-6G", // 点击后的跳转链接
  107. "description" => "优质国外服务器供应商Vultr限时注册送100刀", // Banner描述 用于img标签的alt属性
  108. ],
  109. [
  110. "image" => "/images/banners/ali_affiliate_560x260.png", // 图片路径
  111. "url" => "https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=clx8dxhx", // 点击后的跳转链接
  112. "description" => "阿里云高性能服务器低至2折", // Banner描述 用于img标签的alt属性
  113. ],
  114. [
  115. "image" => "/images/banners/tencent_affiliate_560x260.png", // 图片路径
  116. "url" => "https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=2d48606c208631c31d73aadcb8412bab&from=console", // 点击后的跳转链接
  117. "description" => "推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。", // Banner描述 用于img标签的alt属性
  118. ],
  119. ], JSON_UNESCAPED_UNICODE),
  120. 'created_at' => 1553745930,
  121. 'updated_at' => 1553745930,
  122. ]);
  123. }
  124. }