-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
347dac5
commit 33bfe27
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Kami\Cocktail\Console\Commands; | ||
|
||
use Kami\Cocktail\Models\User; | ||
use Illuminate\Console\Command; | ||
use Illuminate\Support\Facades\Hash; | ||
|
||
class BarAnon extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'bar:anon'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = '[DEV] Anonymize data'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return int | ||
*/ | ||
public function handle() | ||
{ | ||
$users = User::all(); | ||
|
||
foreach ($users as $user) { | ||
$user->email = 'email' . $user->id . '@example.com'; | ||
$user->name = 'User ' . $user->id; | ||
$user->password = Hash::make('Test12345'); | ||
$user->save(); | ||
} | ||
|
||
$this->output->success('Done!'); | ||
|
||
return Command::SUCCESS; | ||
} | ||
} |