| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- use App\Events\SendEmailEvent;
- use App\MailEvent;
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- class AddDefaultEmail extends Migration
- {
- protected $mailEvent;
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- //
- $this->mailEvent = (new MailEvent([
- 'name' => '发送默认邮件',
- 'event_name' => SendEmailEvent::class,
- 'remark' => null,
- 'is_active' => true,
- 'template' => json_encode([
- 'title' => '邮件测试',
- 'description' => '这是一封测试邮件,收到不用回复'
- ]),
- ]))->save();
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- $this->mailEvent->delete();
- }
- }
|