亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

無法刪除 morphpivot 自定義模型 laravel

無法刪除 morphpivot 自定義模型 laravel

PHP
慕田峪9158850 2023-08-26 15:55:57
我正在使用 Laravel 進行項目,并且在刪除自定義 morphPivot 關系時遇到一些問題。當我嘗試刪除關系時,出現以下錯誤:Illuminate/Database/QueryException with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'where clause' (SQL: delete from `comment` where (`` = 01418755-c68e-4ea5-8043-cef348c47445))'從它我認為 laravel 正在嘗試通過 ids 刪除,但 id 列沒有名稱,所以它找不到它。但是,我認為我明確定義了 id 列。這是我的類實現:<?phpuse Illuminate\Support\Facades\Schema;use Illuminate\Database\Schema\Blueprint;use Illuminate\Database\Migrations\Migration;class CreateCommentTable extends Migration{    /**     * Run the migrations.     *     * @return void     */    public function up()    {        Schema::create('comment', function (Blueprint $table) {            $table->uuid('id');            $table->primary('id');            $table->text('content');            $table->boolean('spoiler')->default(false);            $table->boolean('hidden')->default(false);            $table->boolean('edited')->default(false);            $table->uuid('parent_id')->nullable();            $table->uuid('user_id');            $table->uuid('commentable_id');            $table->string('commentable_type');            $table->json('meta')->nullable();            $table->timestamps();        });    }    /**     * Reverse the migrations.     *     * @return void     */    public function down()    {        Schema::dropIfExists('comment');    }}
查看完整描述

1 回答

?
慕森王

TA貢獻1777條經驗 獲得超3個贊

現已在 Laravel 最新版本中修復



查看完整回答
反對 回復 2023-08-26
  • 1 回答
  • 0 關注
  • 159 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號