Skip to content

Commit

Permalink
Merge pull request #226 from nasirkhan/release
Browse files Browse the repository at this point in the history
v7.12.0
  • Loading branch information
nasirkhan committed Oct 7, 2020
2 parents 5dc6422 + e1d45d6 commit 216a8c4
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,5 +318,8 @@
</div>
</div>
</div>

@endsection

@push ("after-scripts")
<script src="https://cdn.jsdelivr.net/npm/sharer.js@latest/sharer.min.js"></script>
@endpush
6 changes: 6 additions & 0 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions app/Http/Controllers/Backend/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']));
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Frontend/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
35 changes: 15 additions & 20 deletions resources/views/backend/users/profileEdit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@

<div class="row">

<div class="col-12 col-md-4">
<div class="col-12 col-sm-6">
<div class="form-group">
<?php
$field_name = 'gender';
Expand All @@ -123,7 +123,7 @@
</div>
</div>

<div class="col-12 col-md-4">
<div class="col-12 col-sm-6">
<div class="form-group">
<?php
$field_name = 'date_of_birth';
Expand All @@ -140,23 +140,6 @@
</div>
</div>
</div>

<div class="col-12 col-md-4">
<div class="form-group">
<?php
$field_name = 'profile_privecy';
$field_lable = label_case($field_name);
$field_placeholder = "-- Select an option --";
$required = "";
$select_options = [
'Public'=>'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"]) }}
</div>
</div>
</div>

<div class="row">
Expand Down Expand Up @@ -186,7 +169,7 @@
</div>
</div>
<div class="row">
<div class="col-12 col-md-3">
<div class="col-12">
<div class="form-group">
<?php
$field_name = 'url_website';
Expand All @@ -210,6 +193,18 @@
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
</div>
</div>
<div class="col-12 col-md-3">
<div class="form-group">
<?php
$field_name = 'url_instagram';
$field_lable = label_case($field_name);
$field_placeholder = $field_lable;
$required = "";
?>
{{ html()->label($field_lable, $field_name) }} {!! fielf_required($required) !!}
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
</div>
</div>
<div class="col-12 col-md-3">
<div class="form-group">
<?php
Expand Down
4 changes: 2 additions & 2 deletions resources/views/frontend/includes/footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
A CMS like modular starter application project built with Laravel 7.
</p>
</div>
<div class="col-6 col-sm-3 col-lg-2 mb-4 mb-lg-0">
<div class="col-6 col-sm-3 col-lg-2 mb-4 mb-lg-0 text-center">
<h6>
Pages
</h6>
Expand All @@ -23,7 +23,7 @@
<li><a target="_blank" href="#">Contact Us</a></li>
</ul>
</div>
<div class="col-6 col-sm-3 col-lg-2 mb-4 mb-lg-0">
<div class="col-6 col-sm-3 col-lg-2 mb-4 mb-lg-0 text-center">
<h6>
Account
</h6>
Expand Down
32 changes: 28 additions & 4 deletions resources/views/frontend/users/profile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@
<div class="container">
<div class="row justify-content-center">
<div class="col-12 col-md-8 text-center">
<!-- <div class="mb-2">
<img class="rounded-circle" style="max-width:150px;" src="{{asset($user->avatar)}}" alt="{{$$module_name_singular->name}}">
</div> -->
<h1 class="display-2 mb-4">
{{$$module_name_singular->name}}
@auth
@if(auth()->user()->id == $$module_name_singular->id)
<small>
<a href="{{ route('frontend.users.profileEdit', $$module_name_singular->id) }}" class="btn btn-primary btn-sm">Edit</a>
<a href="{{ route('frontend.users.profileEdit', $$module_name_singular->id) }}" class="btn btn-secondary btn-sm">Edit</a>
</small>
@endif
@endauth
Expand Down Expand Up @@ -115,7 +112,34 @@
</div>
</div>
</div>

<div class="row justify-content-sm-center align-items-center py-3 mt-3">
<div class="col-12 col-lg-8">
<div class="row">
<div class="col-9 col-md-6">
<h6 class="font-weight-bolder d-inline mb-0 mr-3">Share:</h6>

@php $title_text = $$module_name_singular->name; @endphp

<button class="btn btn-sm mr-3 btn-icon-only btn-pill btn-twitter d-inline" data-sharer="twitter" data-via="LaravelStarter" data-title="{{$title_text}}" data-hashtags="LaravelStarter" data-url="{{url()->full()}}" data-toggle="tooltip" title="Share on Twitter" data-original-title="Share on Twitter">
<span class="btn-inner-icon"><i class="fab fa-twitter"></i></span>
</button>

<button class="btn btn-sm mr-3 btn-icon-only btn-pill btn-facebook d-inline" data-sharer="facebook" data-hashtag="LaravelStarter" data-url="{{url()->full()}}" data-toggle="tooltip" title="Share on Facebook" data-original-title="Share on Facebook">
<span class="btn-inner-icon"><i class="fab fa-facebook-f"></i></span>
</button>
</div>

<div class="col-3 col-md-6 text-right"><i class="far fa-bookmark text-primary" data-toggle="tooltip" data-placement="top" title="" data-original-title="Bookmark story"></i></div>
</div>
</div>
</div>
</div>
</section>

@endsection

@push ("after-scripts")
<script src="https://cdn.jsdelivr.net/npm/sharer.js@latest/sharer.min.js"></script>
@endpush

19 changes: 8 additions & 11 deletions resources/views/frontend/users/profileEdit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
<div class="col-12 col-md-8 text-center">
<h1 class="display-2 mb-4">
{{$$module_name_singular->name}}

@auth
@if(auth()->user()->id == $$module_name_singular->id)
<small>
<a href="{{ route('frontend.users.profileEdit', $$module_name_singular->id) }}" class="btn btn-primary btn-sm">Show</a>
<a href="{{ route('frontend.users.profile', $$module_name_singular->id) }}" class="btn btn-secondary btn-sm">Show</a>
</small>
@endif
@endauth
Expand Down Expand Up @@ -140,7 +141,7 @@
</div>

<div class="row">
<div class="col-6">
<div class="col-12 col-sm-6">
<div class="form-group">
<?php
$field_name = 'address';
Expand All @@ -152,7 +153,7 @@
{{ html()->textarea($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
</div>
</div>
<div class="col-6">
<div class="col-12 col-sm-6">
<div class="form-group">
<?php
$field_name = 'bio';
Expand Down Expand Up @@ -222,16 +223,12 @@
<div class="col-md-10">
<a href="{{ route('frontend.users.changePassword', $$module_name_singular->id) }}" class="btn btn-outline-primary btn-sm"><i class="now-ui-icons objects_key-25"></i>&nbsp;Change password</a>
</div>
</div><!--form-group-->
</div>

<div class="row">
<div class="row mt-4">
<div class="col">
<div class="row">
<div class="col-4">
<div class="form-group">
{!! Form::button("<i class='fas fa-save'></i>&nbsp;Save", ['class' => 'btn btn-success', 'type'=>'submit']) !!}
</div>
</div>
<div class="form-group">
{!! Form::button("<i class='fas fa-save'></i>&nbsp;Save", ['class' => 'btn btn-success', 'type'=>'submit']) !!}
</div>
</div>
</div>
Expand Down

0 comments on commit 216a8c4

Please sign in to comment.