0
我想改變notification
表的名稱更改默認的通知表的名稱,所以我改變了遷移文件:如何Laravel
php artisan notification:table
Schema::create('member_notifications', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
,並試圖在Notification
類使用$table
:
protected $table = 'member_notifications';
但是,當我試圖在數據庫中存儲通知時,出現此錯誤:
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "notifications" does not exist
謝謝,但這不是一個穩定的解決方案,因爲更新後我應該再次編輯這個文件 – MajAfy