diff --git a/app/Models/User.php b/app/Models/User.php index dccda6d2..daabe09d 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\MorphMany; use Spatie\Permission\Traits\HasRoles; +use Illuminate\Database\Eloquent\SoftDeletes; use Tymon\JWTAuth\Contracts\JWTSubject; use Illuminate\Notifications\Notifiable; @@ -24,8 +25,9 @@ class User extends AbstractModel implements AuthorizableContract, CanResetPasswordContract { - use HasRoles, Notifiable, Authenticatable, Authorizable, CanResetPassword, MustVerifyEmail; + use HasRoles, Notifiable, Authenticatable, Authorizable, CanResetPassword, MustVerifyEmail, SoftDeletes; + protected $dates = ['deleted_at']; /** * Get the identifier that will be stored in the subject claim of the JWT. diff --git a/database/migrations/2022_03_14_133555_add_deleted_at_to_users_table.php b/database/migrations/2022_03_14_133555_add_deleted_at_to_users_table.php new file mode 100644 index 00000000..13fa1389 --- /dev/null +++ b/database/migrations/2022_03_14_133555_add_deleted_at_to_users_table.php @@ -0,0 +1,32 @@ +softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + // + }); + } +}