environment("local")) { $this->error( "This command can only be run in the local environment.", ); return; } if ( !$this->confirm( "This will permanently overwrite personal data. Continue?", ) ) { return; } DB::table("users") ->get() ->each(function ($user) { DB::table("users") ->where("id", $user->id) ->update([ "name" => "User {$user->id}", "email" => "user_{$user->id}@example.com", "password" => Hash::make("password"), "remember_token" => null, ]); }); $this->info("Users anonymized."); DB::table("lunar_customers") ->get() ->each(function ($customer) { DB::table("lunar_customers") ->where("id", $customer->id) ->update([ "title" => null, "first_name" => "Customer", "last_name" => (string) $customer->id, "company_name" => null, "tax_identifier" => null, "account_ref" => null, "meta" => null, ]); }); $this->info("Customers anonymized."); } }