FIX: lots of bugfixes
This commit is contained in:
@@ -30,7 +30,7 @@ class ChangePassword extends Command
|
||||
$email = $this->argument('email');
|
||||
try {
|
||||
$user = User::where(['email' => $email])
|
||||
->first();
|
||||
->firstOrFail();
|
||||
} catch (ModelNotFoundException $e) {
|
||||
$this->error('Invalid user ' . $email . '.');
|
||||
return;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\CMS\Enumerations\UserRoles;
|
||||
use App\Events\CreateNewUser;
|
||||
use App\Models\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
@@ -63,6 +64,8 @@ class NewUser extends Command
|
||||
$user->role = $role;
|
||||
$user->save();
|
||||
|
||||
event(new CreateNewUser($user));
|
||||
|
||||
$this->info('User ' . $email . ' successfully created.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user