Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:microweber/microweber into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-mw committed Oct 30, 2023
2 parents 23b64f0 + dc8f399 commit c6e7ea9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 25 deletions.
Expand Up @@ -5,13 +5,11 @@

use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Livewire\WithFileUploads;
use MicroweberPackages\Admin\Http\Livewire\AdminComponent;
use MicroweberPackages\User\Models\User;

class CreateProfileInformationForm extends AdminComponent
{
use WithFileUploads;

/**
* The component's state.
Expand All @@ -30,8 +28,8 @@ public function createProfileInformation()
'username' => ['nullable', 'string', 'max:255', Rule::unique(User::class)],
'email' => ['required', 'email', 'max:255', Rule::unique(User::class)],
'phone' => ['nullable', 'string', 'max:255'],
'password' => ['required', 'string', 'min:4'],
// 'avatar' => ['nullable', 'image', 'max:1024'],
'password' => ['required', 'string', 'min:4']

])->validateWithBag('createProfileInformation');

$user = new User();
Expand Down
Expand Up @@ -8,13 +8,11 @@
use Illuminate\Validation\Rule;
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;
use Livewire\Component;
use Livewire\WithFileUploads;
use MicroweberPackages\Admin\Http\Livewire\AdminComponent;
use MicroweberPackages\User\Models\User;

class UpdateProfileInformationForm extends AdminComponent
{
use WithFileUploads;

/**
* The component's state.
Expand Down
Expand Up @@ -13,10 +13,6 @@
<!-- Profile Photo -->
<div class="form-label mb-3 text-center" x-data="{}">
<!-- Profile Photo File Input -->
<input type="file" hidden
wire:model="photo"
x-ref="photo"
/>

<x-microweber-ui::label for="photo" value="{{ _e('Profile image') }}" />

Expand Down
Expand Up @@ -14,20 +14,7 @@
</x-user::action-message>

<!-- Profile Photo -->
@if (Laravel\Jetstream\Jetstream::managesProfilePhotos())
<div class="mb-3" 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]);
" />
<div class="mb-3" x-data="{photoName: null, photoPreview: null}">

<x-user::label for="photo" value="{{ __('Photo') }}" />

Expand Down Expand Up @@ -57,7 +44,6 @@

<x-user::input-error for="photo" class="mt-2" />
</div>
@endif

<div class="w-md-75">
<!-- Name -->
Expand Down

0 comments on commit c6e7ea9

Please sign in to comment.