0

So at my job we have a project using https://github.com/WildSideUK/Laravel-Userstamps . In existant migrations there's $table->stamps(); which creates created_at, deleted_at, created_by, etc.

This method is not documented at https://laravel.com/docs/5.8/migrations so I'm assuming that that's part of https://github.com/WildSideUK/Laravel-Userstamps but even that doesn't have any documentation on $table->stamps();, let alone how to undo it when rolling back.

I did grep -r "n stamps" . in the projects root directory and didn't find anything, but with Laravel's penchant for magic methods that doesn't surprise me.

Any ideas?

neubert
  • 15,947
  • 24
  • 120
  • 212

1 Answers1

1

$table->stamps() is not a standard Laravel schema builder method. But $table->timestamps() is, and it is the method responsible for creating the created_at and updated_at columns, while deleted_at is added with $table->softDeletes().

To revert these you can use respectively $table->dropTimestamps() and $table->dropSoftDeletes().

gere
  • 1,600
  • 1
  • 12
  • 19