Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117774674
D2797.1775241224.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D2797.1775241224.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D2797: User password command to set a users password
Attached
Detach File
Event Timeline