feat: add profile image editing and update profile validation

This commit is contained in:
2026-08-22 08:15:01 +03:30
parent aea4d96693
commit b0bf4838ba
12 changed files with 556 additions and 28 deletions
+10 -1
View File
@@ -20,7 +20,7 @@
<div class="user-profile-card">
<h4 class="user-profile-card-title">بروزرسانی مشخصات پروفایل</h4>
<div class="user-profile-form">
<form action="{{ route('accounts.edit-profile.update') }}" method="POST">
<form action="{{ route('accounts.edit-profile.update') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="row">
<div class="col-md-6">
@@ -98,6 +98,15 @@
@enderror
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label>عکس پروفایل</label>
<input type="file" name="avatar" class="form-control" accept="image/*">
@error('avatar')
<span class="text-danger">{{ $message }}</span>
@enderror
</div>
</div>
</div>
<button type="submit" class="theme-btn mt-4">آپدیت مشخصات پروفایل <i class="far fa-user"></i>
@@ -2,9 +2,17 @@
<div class="user-profile-sidebar">
<div class="user-profile-sidebar-top">
<div class="user-profile-img">
<img src="{{asset('assets/img/account/user.jpg')}}" alt>
<button type="button" class="profile-img-btn"><i class="far fa-camera"></i></button>
<input type="file" class="profile-img-file">
@if(auth()->user()->avatar?->file)
<img
src="{{ getFileUrl(auth()->user()->avatar->file_id) }}"
alt="img"
class="avatar avatar-sm avatar-rounded">
@else
<img
src="{{ asset('assets/img/account/DefaultAvatar.jpg') }}"
alt="img"
class="avatar avatar-sm avatar-rounded">
@endif
</div>
<h4>{{auth()->user()->first_name . ' ' . auth()->user()->last_name}}</h4>
</div>