untymage
4 months ago
140
1
Laravel

Set parent timestamp as default value

Posted 4 months ago by untymage

Is it possible to get parent updated_at and set it as default value for custom timestamp on child model?

public function up()
{
    Schema::create('child_table', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->unsignedBigInteger('model_id');
        $table->customTimestamp()->default(???? it should be parent updated_at);
    });
}

Please sign in or create an account to participate in this conversation.