Merge pull request #317 from JulianPrieber/image-id
Changed profile picture save method to use user id
This commit is contained in:
commit
369965f55f
|
@ -526,7 +526,7 @@ class UserController extends Controller
|
||||||
User::where('id', $userId)->update(['littlelink_name' => $pageName, 'littlelink_description' => $pageDescription, 'name' => $name]);
|
User::where('id', $userId)->update(['littlelink_name' => $pageName, 'littlelink_description' => $pageDescription, 'name' => $name]);
|
||||||
|
|
||||||
if ($request->hasFile('image')) {
|
if ($request->hasFile('image')) {
|
||||||
$profilePhoto->move(base_path('/img'), $littlelink_name . ".png");
|
$profilePhoto->move(base_path('/img'), $userId . ".png");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Redirect('/studio/page');
|
return Redirect('/studio/page');
|
||||||
|
|
|
@ -250,8 +250,8 @@ function get_operating_system() {
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="column" style="margin-top: 5%">
|
<div class="column" style="margin-top: 5%">
|
||||||
<!-- Your Image Here -->
|
<!-- Your Image Here -->
|
||||||
@if(file_exists(base_path("img/$littlelink_name" . ".png" )))
|
@if(file_exists(base_path("img/" . $userinfo->id . ".png")))
|
||||||
<img alt="avatar" class="rounded-avatar fadein" src="{{ asset("img/$littlelink_name" . ".png") }}" width="128px" height="128px" style="object-fit: cover;">
|
<img alt="avatar" class="rounded-avatar fadein" src="{{ asset("img/" . $userinfo->id . ".png") }}" width="128px" height="128px" style="object-fit: cover;">
|
||||||
@elseif(file_exists(base_path("littlelink/images/").findFile('avatar')))
|
@elseif(file_exists(base_path("littlelink/images/").findFile('avatar')))
|
||||||
<img alt="avatar" class="rounded-avatar fadein" src="{{ asset('littlelink/images/'.findFile('avatar')) }}" srcset="{{ asset('littlelink/images/avatar@2x.png 2x') }}" width="128px" height="128px" style="object-fit: cover;">
|
<img alt="avatar" class="rounded-avatar fadein" src="{{ asset('littlelink/images/'.findFile('avatar')) }}" srcset="{{ asset('littlelink/images/avatar@2x.png 2x') }}" width="128px" height="128px" style="object-fit: cover;">
|
||||||
@else
|
@else
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-lg-8">
|
<div class="form-group col-lg-8">
|
||||||
@if(file_exists(base_path("img/$user->littlelink_name" . ".png" )))
|
@if(file_exists(base_path("img/" . $user->id . ".png")))
|
||||||
<img src="{{ asset("img/$user->littlelink_name" . ".png") }}" srcset="{{ asset("img/$user->littlelink_name" . "@2x.png 2x") }}" width="128px" height="128px" style="object-fit: cover;">
|
<img src="{{ asset("img/" . $user->id . ".png") }}" srcset="{{ asset("img/$user->littlelink_name" . "@2x.png 2x") }}" width="128px" height="128px" style="object-fit: cover;">
|
||||||
@elseif(file_exists(base_path("littlelink/images/").findFile('avatar')))
|
@elseif(file_exists(base_path("littlelink/images/").findFile('avatar')))
|
||||||
<img class="rounded-avatar" src="{{ asset('littlelink/images/'.findFile('avatar')) }}" srcset="{{ asset('littlelink/images/avatar@2x.png 2x') }}" width="128px" height="128px" style="object-fit: cover;">
|
<img class="rounded-avatar" src="{{ asset('littlelink/images/'.findFile('avatar')) }}" srcset="{{ asset('littlelink/images/avatar@2x.png 2x') }}" width="128px" height="128px" style="object-fit: cover;">
|
||||||
@else
|
@else
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="form-group col-lg-8">
|
<div class="form-group col-lg-8">
|
||||||
@if(file_exists(base_path("img/$page->littlelink_name" . ".png" )))
|
@if(file_exists(base_path("img/" . Auth::user()->id . ".png")))
|
||||||
<img src="{{ asset("img/$page->littlelink_name" . ".png") }}" style="width: 75px; height: 75px; border-radius: 50%; object-fit: cover;">
|
<img src="{{ asset("img/" . Auth::user()->id . ".png") }}" style="width: 75px; height: 75px; border-radius: 50%; object-fit: cover;">
|
||||||
@else
|
@else
|
||||||
@if(!empty($page->image))
|
@if(!empty($page->image))
|
||||||
<img src="{{ $page->image }}" style="width: 75px; height: 75px; object-fit: cover;">
|
<img src="{{ $page->image }}" style="width: 75px; height: 75px; object-fit: cover;">
|
||||||
|
|
Loading…
Reference in New Issue