diff --git a/Modules/Article/Resources/views/frontend/posts/show.blade.php b/Modules/Article/Resources/views/frontend/posts/show.blade.php index a109a128a..8c97d47fd 100644 --- a/Modules/Article/Resources/views/frontend/posts/show.blade.php +++ b/Modules/Article/Resources/views/frontend/posts/show.blade.php @@ -318,5 +318,8 @@ - @endsection + +@push ("after-scripts") + +@endpush diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index a5a5bdc6c..932b58cb1 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -85,6 +85,12 @@ protected function create(array $data) 'password' => Hash::make($data['password']), ]); + // username + $id = $user->id; + $username = 100000+$id; + $user->username = $username; + $user->save(); + event(new UserRegistered($user)); return $user; diff --git a/app/Http/Controllers/Backend/UserController.php b/app/Http/Controllers/Backend/UserController.php index f89467e99..40754f58e 100644 --- a/app/Http/Controllers/Backend/UserController.php +++ b/app/Http/Controllers/Backend/UserController.php @@ -598,6 +598,16 @@ public function update(Request $request, $id) $module_action = 'Update'; + $request->validate([ + 'first_name'=> 'required|min:3|max:191', + 'last_name' => 'required|min:3|max:191', + 'url_website' => 'nullable|min:3|max:191', + 'url_facebook' => 'nullable|min:3|max:191', + 'url_twitter' => 'nullable|min:3|max:191', + 'url_instagram' => 'nullable|min:3|max:191', + 'url_linkedin' => 'nullable|min:3|max:191', + ]); + $$module_name_singular = User::findOrFail($id); $$module_name_singular->update($request->except(['roles', 'permissions'])); diff --git a/app/Http/Controllers/Frontend/UserController.php b/app/Http/Controllers/Frontend/UserController.php index 0c18db5c1..6a65f6669 100644 --- a/app/Http/Controllers/Frontend/UserController.php +++ b/app/Http/Controllers/Frontend/UserController.php @@ -164,6 +164,8 @@ public function profileUpdate(Request $request, $id) } $this->validate($request, [ + 'first_name' => 'required|string|max:191', + 'last_name' => 'required|string|max:191', 'avatar' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048', ]); diff --git a/app/Listeners/Frontend/UserProfileUpdated/UserProfileUpdatedUserUpdate.php b/app/Listeners/Frontend/UserProfileUpdated/UserProfileUpdatedUserUpdate.php index f445ee9f8..25e744b7b 100644 --- a/app/Listeners/Frontend/UserProfileUpdated/UserProfileUpdatedUserUpdate.php +++ b/app/Listeners/Frontend/UserProfileUpdated/UserProfileUpdatedUserUpdate.php @@ -34,12 +34,13 @@ public function handle(UserProfileUpdated $event) $user->name = $user_profile->name; $user->first_name = $user_profile->first_name; $user->last_name = $user_profile->last_name; + $user->username = $user_profile->username; $user->email = $user_profile->email; $user->mobile = $user_profile->mobile; $user->gender = $user_profile->gender; $user->date_of_birth = $user_profile->date_of_birth; $user->gender = $user_profile->gender; - + $user->save(); } } diff --git a/app/Listeners/Frontend/UserRegistered/UserRegisteredProfileCreate.php b/app/Listeners/Frontend/UserRegistered/UserRegisteredProfileCreate.php index 4a5862050..59e991aa8 100644 --- a/app/Listeners/Frontend/UserRegistered/UserRegisteredProfileCreate.php +++ b/app/Listeners/Frontend/UserRegistered/UserRegisteredProfileCreate.php @@ -34,6 +34,7 @@ public function handle(UserRegistered $event) $userprofile->name = $user->name; $userprofile->first_name = $user->first_name; $userprofile->last_name = $user->last_name; + $userprofile->username = $user->username; $userprofile->email = $user->email; $userprofile->mobile = $user->mobile; $userprofile->gender = $user->gender; diff --git a/composer.json b/composer.json index c93fca8c7..c62b1a536 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["framework", "laravel", "cms", "starter", "admin", "admin dashboard"], "license": "GPL-3.0-or-later", "type": "project", - "version": "v7.11.0", + "version": "v7.12.0", "require": { "php": "^7.2.5", "alexusmai/laravel-file-manager": "^2.4", diff --git a/database/migrations/2020_02_19_173700_create_userprofiles_table.php b/database/migrations/2020_02_19_173700_create_userprofiles_table.php index cc262018a..5607c4ad3 100644 --- a/database/migrations/2020_02_19_173700_create_userprofiles_table.php +++ b/database/migrations/2020_02_19_173700_create_userprofiles_table.php @@ -28,9 +28,9 @@ public function up() $table->string('url_website')->nullable(); $table->string('url_facebook')->nullable(); $table->string('url_twitter')->nullable(); + $table->string('url_instagram')->nullable(); $table->string('url_linkedin')->nullable(); - $table->string('profile_privecy')->nullable(); $table->date('date_of_birth')->nullable(); $table->text('address')->nullable(); $table->text('bio')->nullable(); diff --git a/resources/views/backend/users/profileEdit.blade.php b/resources/views/backend/users/profileEdit.blade.php index 9198f1ff1..18cb08c87 100644 --- a/resources/views/backend/users/profileEdit.blade.php +++ b/resources/views/backend/users/profileEdit.blade.php @@ -105,7 +105,7 @@
-
+
-
+
- -
-
- 'Public', - 'Private'=>'Private', - ]; - ?> - {{ html()->label($field_lable, $field_name) }} {!! fielf_required($required) !!} - {{ html()->select($field_name, $select_options)->placeholder($field_placeholder)->class('form-control select2')->attributes(["$required"]) }} -
-
@@ -186,7 +169,7 @@
-
+
text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
+
+
+ + {{ html()->label($field_lable, $field_name) }} {!! fielf_required($required) !!} + {{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }} +
+
-
+
Pages
@@ -23,7 +23,7 @@
  • Contact Us
  • -
    +
    Account
    diff --git a/resources/views/frontend/users/profile.blade.php b/resources/views/frontend/users/profile.blade.php index 88edb96ad..91f103c0e 100644 --- a/resources/views/frontend/users/profile.blade.php +++ b/resources/views/frontend/users/profile.blade.php @@ -8,15 +8,12 @@
    -

    {{$$module_name_singular->name}} @auth @if(auth()->user()->id == $$module_name_singular->id) - Edit + Edit @endif @endauth @@ -115,7 +112,34 @@

    + +
    +
    +
    +
    +
    Share:
    + + @php $title_text = $$module_name_singular->name; @endphp + + + + +
    + +
    +
    +
    +
    @endsection + +@push ("after-scripts") + +@endpush + diff --git a/resources/views/frontend/users/profileEdit.blade.php b/resources/views/frontend/users/profileEdit.blade.php index 0c81c54c6..95c368798 100644 --- a/resources/views/frontend/users/profileEdit.blade.php +++ b/resources/views/frontend/users/profileEdit.blade.php @@ -10,10 +10,11 @@

    {{$$module_name_singular->name}} + @auth @if(auth()->user()->id == $$module_name_singular->id) - Show + Show @endif @endauth @@ -140,7 +141,7 @@

    -
    +
    textarea($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
    - -
    +
    -
    -
    -
    - {!! Form::button(" Save", ['class' => 'btn btn-success', 'type'=>'submit']) !!} -
    -
    +
    + {!! Form::button(" Save", ['class' => 'btn btn-success', 'type'=>'submit']) !!}