assertchris / tutorial-laravel-4-e-commerce

Other
97 stars 56 forks source link

using eloquent's magic instead of datetime fields #1

Closed gustavor closed 10 years ago

gustavor commented 10 years ago

Hey @formativ,

Great tutorial on using L4 to create a simple e-commerce site. While reading I thought why you didn't use Eloquent's "magic" methods instead of datetime fields (updated_at, created_at, deleted_at). Eloquent has $table->timestamps();and $table->softDeletes that should be more "universal". How about using them?

Cheers!

assertchris commented 10 years ago

There's nothing wrong with Eloquent's magic; but it is just that. I prefer explicitly naming the fields, as there's currently no way to configure what the names of those fields are. Gonna keep them as the yare, for now, but I will add a note to the tutorial. Thanks for the feedback! :)