pipe-dream / laravel-create

Create Laravel projects really fast
1.31k stars 109 forks source link

Optional softdeletes on models #53

Closed septIO closed 5 years ago

septIO commented 5 years ago

SoftDeletes are awesome, and should be used everywhere. Makes it easier to restore "accidentally" deleted items etc.

This PR implements SoftDeletes on all models, disabled by default SoftDeletes can be enabled either by manually setting the softdeletes property in the Schema, or by having a models first attribute be softdeletes

The migration will automatically append the softdeletes column, and the model will also have the use softdeletes.

Example:

// This will not have softdeletes. Deletion of models will be permanent
Car
brand
color
user_id
// Identical to the above model, but Car::first()->delete() can be restored by changing the deleted_at timestamp to null
Car
softdeletes
brand
color
user_id
ajthinking commented 5 years ago

Awesome indeed 💥💥💥 You da real MVP !