From cf449eb8e2fe8a7118ba3f6271ff392e8556d982 Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Wed, 28 Jun 2023 23:05:31 +0600 Subject: [PATCH] Add SoftDeletes feature to User model. --- app/Models/User.php | 3 ++- database/migrations/2014_10_12_000000_create_users_table.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Models/User.php b/app/Models/User.php index 23b4063..7305dc7 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -4,13 +4,14 @@ namespace App\Models; // use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Laravel\Sanctum\HasApiTokens; class User extends Authenticatable { - use HasApiTokens, HasFactory, Notifiable; + use HasApiTokens, HasFactory, Notifiable, SoftDeletes; /** * The attributes that are mass assignable. diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 444fafb..76d2754 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -19,6 +19,7 @@ return new class extends Migration $table->string('password'); $table->rememberToken(); $table->timestamps(); + $table->softDeletes(); }); }