File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed
Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change 44
55use App \Models \User ;
66use Illuminate \Http \Request ;
7+ use Illuminate \Support \Facades \Hash ;
78
89class RegisterController extends Controller
910{
@@ -29,7 +30,9 @@ public function __invoke(Request $request)
2930 return $ this ->failure ('E-Mail already taken. ' );
3031 }
3132
32- $ user = User::create ($ request ->all ());
33+ $ user = User::create (array_merge ($ request ->all (), [
34+ 'password ' => Hash::make ($ request ->password ),
35+ ]));
3336
3437 return response ()->json ([
3538 'success ' => true ,
Original file line number Diff line number Diff line change 77use Illuminate \Database \Eloquent \Factories \HasFactory ;
88use Illuminate \Foundation \Auth \User as Authenticatable ;
99use Illuminate \Notifications \Notifiable ;
10- use Illuminate \Support \Facades \Hash ;
1110use Tymon \JWTAuth \Contracts \JWTSubject ;
1211
1312class User extends Authenticatable implements JWTSubject
@@ -46,16 +45,4 @@ class User extends Authenticatable implements JWTSubject
4645 protected $ casts = [
4746 'email_verified_at ' => 'datetime ' ,
4847 ];
49-
50- /**
51- * Perform any actions required after the model boots.
52- *
53- * @return void
54- */
55- protected static function booted ()
56- {
57- static ::creating (function (User $ user ) {
58- $ user ->fill (['password ' => Hash::make ($ user ->password )]);
59- });
60- }
6148}
You can’t perform that action at this time.
0 commit comments