diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index a41e7e6..e75c0bd 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -69,7 +69,7 @@ protected function create(array $data) 'username' => $data['username'], 'name' => $data['name'], 'email' => $data['email'], - 'password' => Hash::make($data['password']), + 'password' => $data['password'], ]); } } diff --git a/app/Http/Controllers/ProfilesController.php b/app/Http/Controllers/ProfilesController.php index 557fcc2..60dcc0d 100644 --- a/app/Http/Controllers/ProfilesController.php +++ b/app/Http/Controllers/ProfilesController.php @@ -31,8 +31,6 @@ public function edit() public function update() { - - // dd(request()); $user = current_user(); $attributes = request()->validate([ @@ -45,7 +43,7 @@ public function update() if ( !empty(request('password')) ){ $attributes['password'] = request()->validate([ - 'password' => ['string', 'min:5', 'max:255', 'confirmed'] + 'password' => ['string', 'min:8', 'max:255', 'confirmed'] ])['password']; } diff --git a/app/helpers.php b/app/helpers.php index 680a7b8..6ab9e79 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -1,6 +1,8 @@ user(); +if (!function_exists('current_user')) { + function current_user() + { + return auth()->user(); + } } \ No newline at end of file diff --git a/composer.json b/composer.json index d0c8c6b..68b0a8e 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ ], "license": "MIT", "require": { - "php": "^7.3", + "php": "^7.4", "fideloper/proxy": "^4.2", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 604f210..cab23a6 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -8,11 +8,15 @@ > @csrf + @error('login_error') +
{{ $message }}
+ @enderror +