
[Laravel] updated_atの更新を無効化する方法
Laravelでのデータベース更新クエリでupdated_atを更新したくない、カラムが存在しない場合など。
既存のEloquentモデルでは下記の用に自動で挿入されます。
Illuminate\Database\Eloquent\Concerns\HasTimestamps
    ...
     /**
     * Update the creation and update timestamps.
     *
     * @return void
     */
    protected function updateTimestamps()
    {
        $time = $this->freshTimestamp();
        if (! $this->isDirty(static::UPDATED_AT)) {
            $this->setUpdatedAt($time);
        }
        if (! $this->exists && ! $this->isDirty(static::CREATED_AT)) {
            $this->setCreatedAt($time);
        }
    }
    /**
     * Set the value of the "created at" attribute.
     *
     * @param  mixed  $value
     * @return $this
     */
    public function setCreatedAt($value)
    {
        $this->{static::CREATED_AT} = $value;
        return $this;
    }
    /**
     * Set the value of the "updated at" attribute.
     *
     * @param  mixed  $value
     * @return $this
     */
    public function setUpdatedAt($value)
    {
        $this->{static::UPDATED_AT} = $value;
        return $this;
    }
    ...updated_atを更新したくないモデルで以下のようにオーバーライドします。
   /**
     * `updated_at`の自動挿入の無効化
     *
     * @param mixed $value
     * @return $this
     */
    public function setUpdatedAt($value)
    {
        return $this;
    }created_atに関しても同じように対応可能です。