Skip to content

Commit 5e4dd12

Browse files
Merge pull request #210 from MrPunyapal/chore/remove-unwanted-hash-make-from-factory
chore: remove unwanted hash::make from factory.
2 parents 5f5bcb5 + eb5e27d commit 5e4dd12

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

app/Http/Controllers/Auth/NewPasswordController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Illuminate\Auth\Events\PasswordReset;
77
use Illuminate\Http\RedirectResponse;
88
use Illuminate\Http\Request;
9-
use Illuminate\Support\Facades\Hash;
109
use Illuminate\Support\Facades\Password;
1110
use Illuminate\Support\Str;
1211
use Illuminate\Validation\Rules;
@@ -47,7 +46,7 @@ public function store(Request $request): RedirectResponse
4746
$request->only('email', 'password', 'password_confirmation', 'token'),
4847
function ($user) use ($request) {
4948
$user->forceFill([
50-
'password' => Hash::make($request->password),
49+
'password' => $request->password,
5150
'remember_token' => Str::random(60),
5251
])->save();
5352

app/Http/Controllers/Auth/RegisteredUserController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Illuminate\Http\RedirectResponse;
99
use Illuminate\Http\Request;
1010
use Illuminate\Support\Facades\Auth;
11-
use Illuminate\Support\Facades\Hash;
1211
use Illuminate\Validation\Rules;
1312
use Inertia\Inertia;
1413
use Inertia\Response;
@@ -39,7 +38,7 @@ public function store(Request $request): RedirectResponse
3938
$user = User::create([
4039
'name' => $request->name,
4140
'email' => $request->email,
42-
'password' => Hash::make($request->password),
41+
'password' => $request->password,
4342
]);
4443

4544
event(new Registered($user));

app/Http/Controllers/Settings/PasswordController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use App\Http\Controllers\Controller;
66
use Illuminate\Http\RedirectResponse;
77
use Illuminate\Http\Request;
8-
use Illuminate\Support\Facades\Hash;
98
use Illuminate\Validation\Rules\Password;
109
use Inertia\Inertia;
1110
use Inertia\Response;
@@ -31,7 +30,7 @@ public function update(Request $request): RedirectResponse
3130
]);
3231

3332
$request->user()->update([
34-
'password' => Hash::make($validated['password']),
33+
'password' => $validated['password'],
3534
]);
3635

3736
return back();

database/factories/UserFactory.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Database\Factories;
44

55
use Illuminate\Database\Eloquent\Factories\Factory;
6-
use Illuminate\Support\Facades\Hash;
76
use Illuminate\Support\Str;
87

98
/**
@@ -27,7 +26,7 @@ public function definition(): array
2726
'name' => fake()->name(),
2827
'email' => fake()->unique()->safeEmail(),
2928
'email_verified_at' => now(),
30-
'password' => static::$password ??= Hash::make('password'),
29+
'password' => static::$password ??= 'password',
3130
'remember_token' => Str::random(10),
3231
'two_factor_secret' => Str::random(10),
3332
'two_factor_recovery_codes' => Str::random(10),

0 commit comments

Comments
 (0)