Open ghost opened 5 years ago
Can you clarify how they are supposed to work?
In my experience this is best left to a change log table as most of the time you'd want to know what exactly each user changed.
Package like https://github.com/owen-it/laravel-auditing does that and more.
@tomschlick, just a simple implementation just like the updated_at, most of the projects won't have it necessary to know what changed in the model.
@Sladewill, I was looking into a more simple implementation that could be used in every project of small or medium scope. Every project that I work I have to do that by hand, every time I use timestamps I also use this.
@mfn, just a more complete implementation of the timestamp, this is just basic for "everyday use". To make easier to track who used that table. As @tomschlick said, this could be evolved to make possible to know what exactly the user changed, but in most of the cases (small projects), just the basic is enough.
I understand. To me, the current proposal doesn't feel right being included by default.
I believe a) the majority will not need this and b) the ones who need something like this, need a more complete solution (as suggested by others).
I built a package a while back that does just this: https://github.com/arkitecht/laravel-attributions If there is interest I can update it / polish it some
Similar to
$table->timestamps()
, the migrations would benefit from having$table->userstamps()
that would add the following columns to the table:And also having the const inside eloquent models for changing the user stamps configuration: