-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathupdate-profile-information-form.blade.php
More file actions
82 lines (69 loc) · 3.19 KB
/
Copy pathupdate-profile-information-form.blade.php
File metadata and controls
82 lines (69 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<x-jet-form-section submit="updateProfileInformation">
<x-slot name="title">
{{ __('Profile Information') }}
</x-slot>
<x-slot name="description">
{{ __('Update your account\'s profile information and email address.') }}
</x-slot>
<x-slot name="form">
<x-jet-action-message on="saved">
{{ __('Saved.') }}
</x-jet-action-message>
<!-- Profile Photo -->
@if (Laravel\Jetstream\Jetstream::managesProfilePhotos())
<div class="form-group" x-data="{photoName: null, photoPreview: null}">
<!-- Profile Photo File Input -->
<input type="file" hidden
wire:model="photo"
x-ref="photo"
x-on:change="
photoName = $refs.photo.files[0].name;
const reader = new FileReader();
reader.onload = (e) => {
photoPreview = e.target.result;
};
reader.readAsDataURL($refs.photo.files[0]);
" />
<x-jet-label for="photo" value="{{ __('Photo') }}" />
<!-- Current Profile Photo -->
<div class="mt-2" x-show="! photoPreview">
<img src="{{ $this->user->profile_photo_url }}" class="rounded-circle" height="80" width="80">
</div>
<!-- New Profile Photo Preview -->
<div class="mt-2" x-show="photoPreview">
<img x-bind:src="photoPreview" class="rounded-circle" width="80" height="80">
</div>
<x-jet-secondary-button class="mt-2 me-2" type="button" x-on:click.prevent="$refs.photo.click()">
{{ __('Select A New Photo') }}
</x-jet-secondary-button>
@if ($this->user->profile_photo_path)
<x-jet-secondary-button type="button" class="mt-2" wire:click="deleteProfilePhoto">
{{ __('Remove Photo') }}
</x-jet-secondary-button>
@endif
<x-jet-input-error for="photo" class="mt-2" />
</div>
@endif
<div class="w-md-75">
<!-- Name -->
<div class="form-group">
<x-jet-label for="name" value="{{ __('Name') }}" />
<x-jet-input id="name" type="text" class="{{ $errors->has('name') ? 'is-invalid' : '' }}" wire:model.defer="state.name" autocomplete="name" />
<x-jet-input-error for="name" />
</div>
<!-- Email -->
<div class="form-group">
<x-jet-label for="email" value="{{ __('Email') }}" />
<x-jet-input id="email" type="email" class="{{ $errors->has('email') ? 'is-invalid' : '' }}" wire:model.defer="state.email" />
<x-jet-input-error for="email" />
</div>
</div>
</x-slot>
<x-slot name="actions">
<div class="d-flex align-items-baseline">
<x-jet-button>
{{ __('Save') }}
</x-jet-button>
</div>
</x-slot>
</x-jet-form-section>