Page MenuHomePhorge

D2797.1775241224.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D2797.1775241224.diff

diff --git a/src/app/Console/Commands/User/PasswordCommand.php b/src/app/Console/Commands/User/PasswordCommand.php
new file mode 100644
--- /dev/null
+++ b/src/app/Console/Commands/User/PasswordCommand.php
@@ -0,0 +1,41 @@
+<?php
+
+namespace App\Console\Commands\User;
+
+use App\Console\Command;
+
+class PasswordCommand extends Command
+{
+ /**
+ * The name and signature of the console command.
+ *
+ * @var string
+ */
+ protected $signature = 'user:password {user} {password}';
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = 'Set a users password';
+
+ /**
+ * Execute the console command.
+ *
+ * @return mixed
+ */
+ public function handle()
+ {
+ $user = $this->getUser($this->argument('user'), true);
+
+ if (!$user) {
+ $this->error('User not found.');
+ return 1;
+ }
+
+ $user->setPasswordAttribute($this->argument('password'));
+ $user->save();
+ $this->info('Password updated.');
+ }
+}

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 3, 6:33 PM (4 h, 53 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18825624
Default Alt Text
D2797.1775241224.diff (1 KB)

Event Timeline