feat: add profile image editing and update profile validation
This commit is contained in:
@@ -6,10 +6,14 @@ use App\Http\Controllers\Controller;
|
|||||||
use App\Http\Requests\Account\EditProfileChangePasswordRequest;
|
use App\Http\Requests\Account\EditProfileChangePasswordRequest;
|
||||||
use App\Http\Requests\Account\EditProfileUpdateRequest;
|
use App\Http\Requests\Account\EditProfileUpdateRequest;
|
||||||
use App\Models\City;
|
use App\Models\City;
|
||||||
|
use App\Models\File;
|
||||||
use App\Models\Province;
|
use App\Models\Province;
|
||||||
|
use App\Models\UserAvatar;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class EditProfileController extends Controller
|
class EditProfileController extends Controller
|
||||||
{
|
{
|
||||||
@@ -24,23 +28,67 @@ class EditProfileController extends Controller
|
|||||||
if ($selectedProvinceId) {
|
if ($selectedProvinceId) {
|
||||||
$cities = City::where('province_id', $selectedProvinceId)->orderBy('name')->get();
|
$cities = City::where('province_id', $selectedProvinceId)->orderBy('name')->get();
|
||||||
}
|
}
|
||||||
return view('account.edit-profile', compact('title','user', 'provinces' , 'cities'));
|
return view('account.edit-profile', compact('title', 'user', 'provinces', 'cities'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(EditProfileUpdateRequest $request)
|
public function update(EditProfileUpdateRequest $request)
|
||||||
{
|
{
|
||||||
$inputs = $request->only([
|
$data = $request->validated();
|
||||||
'first_name',
|
$user = Auth::user();
|
||||||
'last_name',
|
|
||||||
'email',
|
DB::beginTransaction();
|
||||||
'mobile',
|
|
||||||
'city_id',
|
try {
|
||||||
'province_id',
|
|
||||||
|
$user->update([
|
||||||
|
'first_name' => $data['first_name'],
|
||||||
|
'last_name' => $data['last_name'],
|
||||||
|
'email' => $data['email'],
|
||||||
|
'mobile' => $data['mobile'],
|
||||||
|
'province_id' => $data['province_id'] ?? null,
|
||||||
|
'city_id' => $data['city_id'] ?? null,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Auth::user()->update($inputs);
|
if ($request->hasFile('avatar')) {
|
||||||
|
$avatarFile = $request->file('avatar');
|
||||||
|
$imageName = $user->id . '_' . time() . rand(11111, 99999) . '.' . $avatarFile->extension();
|
||||||
|
|
||||||
|
$oldAvatar = UserAvatar::where('user_id', $user->id)->first();
|
||||||
|
|
||||||
|
if ($oldAvatar) {
|
||||||
|
$oldFile = File::find($oldAvatar->file_id);
|
||||||
|
deleteFile($oldFile);
|
||||||
|
$oldAvatar->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
$path = $avatarFile->storeAs('avatars', $imageName, 'public');
|
||||||
|
|
||||||
|
$file = File::create([
|
||||||
|
'name' => $avatarFile->getClientOriginalName(),
|
||||||
|
'original_name' => $avatarFile->getClientOriginalName(),
|
||||||
|
'size' => $avatarFile->getSize(),
|
||||||
|
'extension' => $avatarFile->extension(),
|
||||||
|
'path' => $path
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
UserAvatar::create([
|
||||||
|
'user_id' => $user->id,
|
||||||
|
'file_id' => $file->id,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
DB::commit();
|
||||||
|
|
||||||
return redirect()->back()->with('success', 'پروفایل با موفقیت ویرایش شد.');
|
return redirect()->back()->with('success', 'پروفایل با موفقیت ویرایش شد.');
|
||||||
|
} catch (\Exception $exception) {
|
||||||
|
Log::error($exception);
|
||||||
|
DB::rollBack();
|
||||||
|
|
||||||
|
return redirect()->back()
|
||||||
|
->withInput()
|
||||||
|
->with('error', 'خطایی در ویرایش پروفایل رخ داد. لطفاً دوباره تلاش کنید.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function changePassword(EditProfileChangePasswordRequest $request)
|
public function changePassword(EditProfileChangePasswordRequest $request)
|
||||||
|
|||||||
@@ -54,6 +54,12 @@ class EditProfileUpdateRequest extends FormRequest
|
|||||||
'nullable',
|
'nullable',
|
||||||
'exists:cities,id'
|
'exists:cities,id'
|
||||||
],
|
],
|
||||||
|
'avatar' => [
|
||||||
|
'nullable',
|
||||||
|
'image',
|
||||||
|
'mimes:jpeg,png,jpg,webp',
|
||||||
|
'max:800'
|
||||||
|
]
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<div class="user-profile-card">
|
<div class="user-profile-card">
|
||||||
<h4 class="user-profile-card-title">بروزرسانی مشخصات پروفایل</h4>
|
<h4 class="user-profile-card-title">بروزرسانی مشخصات پروفایل</h4>
|
||||||
<div class="user-profile-form">
|
<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
|
@csrf
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@@ -98,6 +98,15 @@
|
|||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</div>
|
||||||
<button type="submit" class="theme-btn mt-4">آپدیت مشخصات پروفایل <i class="far fa-user"></i>
|
<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">
|
||||||
<div class="user-profile-sidebar-top">
|
<div class="user-profile-sidebar-top">
|
||||||
<div class="user-profile-img">
|
<div class="user-profile-img">
|
||||||
<img src="{{asset('assets/img/account/user.jpg')}}" alt>
|
@if(auth()->user()->avatar?->file)
|
||||||
<button type="button" class="profile-img-btn"><i class="far fa-camera"></i></button>
|
<img
|
||||||
<input type="file" class="profile-img-file">
|
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>
|
</div>
|
||||||
<h4>{{auth()->user()->first_name . ' ' . auth()->user()->last_name}}</h4>
|
<h4>{{auth()->user()->first_name . ' ' . auth()->user()->last_name}}</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
<div class="user-profile-sidebar">
|
||||||
|
<div class="user-profile-sidebar-top">
|
||||||
|
<div class="user-profile-img">
|
||||||
|
<?php if(auth()->user()->avatar?->file): ?>
|
||||||
|
<img
|
||||||
|
src="<?php echo e(getFileUrl(auth()->user()->avatar->file_id)); ?>"
|
||||||
|
alt="img"
|
||||||
|
class="avatar avatar-sm avatar-rounded">
|
||||||
|
<?php else: ?>
|
||||||
|
<img
|
||||||
|
src="<?php echo e(asset('assets/img/account/DefaultAvatar.jpg')); ?>"
|
||||||
|
alt="img"
|
||||||
|
class="avatar avatar-sm avatar-rounded">
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<h4><?php echo e(auth()->user()->first_name . ' ' . auth()->user()->last_name); ?></h4>
|
||||||
|
</div>
|
||||||
|
<ul class="user-profile-sidebar-list">
|
||||||
|
<li><a class="active" href="<?php echo e(route('accounts.profile')); ?>"><i class="far fa-user"></i> نمایه من</a></li>
|
||||||
|
<li><a href="profile-booking.html"><i class="far fa-shopping-bag"></i> رزرو من</a></li>
|
||||||
|
<li><a href="<?php echo e(route('accounts.favorites.index')); ?>"><i class="far fa-heart"></i> علاقه مندی های من</a></li>
|
||||||
|
<li><a href="<?php echo e(route('accounts.comments')); ?>"><i class="fas fa-comments"></i> کامنتهای من</a></li>
|
||||||
|
<li><a href="<?php echo e(route('accounts.edit-profile.index')); ?>"><i class="far fa-cog"></i> ویرایش حساب کاربری</a></li>
|
||||||
|
<li><a href="<?php echo e(route('auth.logout')); ?>"><i class="far fa-sign-out"></i> خروج</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php /**PATH C:\Users\ASUS\Desktop\airline-agency\resources\views/account/layouts/sidebar.blade.php ENDPATH**/ ?>
|
||||||
@@ -57,10 +57,29 @@
|
|||||||
<span class="far fa-shopping-bag"></span>
|
<span class="far fa-shopping-bag"></span>
|
||||||
اکنون ثبت کن
|
اکنون ثبت کن
|
||||||
</button>
|
</button>
|
||||||
<a href="#" class="border-btn">
|
|
||||||
|
<?php if(auth()->guard()->check()): ?>
|
||||||
|
<form action="<?php echo e(route('accounts.favorites.tour.toggle', ['tour' => $tour->id])); ?>"
|
||||||
|
method="POST"
|
||||||
|
class="d-inline">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
|
||||||
|
<button type="submit" class="border-btn border-0">
|
||||||
|
<?php if($isFavorite): ?>
|
||||||
|
<i class="fas fa-heart"></i>
|
||||||
|
حذف از علاقهمندیها
|
||||||
|
<?php else: ?>
|
||||||
<i class="far fa-heart"></i>
|
<i class="far fa-heart"></i>
|
||||||
افزودن به علاقه مندی ها
|
افزودن به علاقهمندیها
|
||||||
|
<?php endif; ?>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<?php else: ?>
|
||||||
|
<a href="<?php echo e(route('auth.login.index')); ?>" class="border-btn">
|
||||||
|
<i class="far fa-heart"></i>
|
||||||
|
افزودن به علاقهمندیها
|
||||||
</a>
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?php $__env->startSection('account-content'); ?>
|
||||||
|
<div class="user-profile-wrapper">
|
||||||
|
<div class="user-profile-card">
|
||||||
|
<h4 class="user-profile-card-title">پروفایل</h4>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="profile-info-list">
|
||||||
|
<ul>
|
||||||
|
<li>اسم کامل : <span><?php echo e($user->first_name . ' ' . $user->last_name); ?></span></li>
|
||||||
|
<li>ایمیل:
|
||||||
|
<span>
|
||||||
|
<a href="/cdn-cgi/l/email-protection" class="__cf_email__"
|
||||||
|
data-cfemail="680207061b0706280d10090518040d460b0705">
|
||||||
|
<?php echo e($user->email); ?>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li>شماره: <span><?php echo e($user->mobile); ?></span></li>
|
||||||
|
<li>تاریخ عضویت: <span><?php echo e($user->created_at->toJalali()->format('Y-m-d')); ?></span></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
|
||||||
|
<?php echo $__env->make('account.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\ASUS\Desktop\airline-agency\resources\views/account/profile.blade.php ENDPATH**/ ?>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<main class="main">
|
||||||
|
<div class="site-breadcrumb" style="background: url(<?php echo e(asset('assets/img/breadcrumb/02.jpg')); ?>)">
|
||||||
|
<div class="container">
|
||||||
|
<h2 class="breadcrumb-title"><?php echo $__env->yieldContent('title'); ?></h2>
|
||||||
|
<ul class="breadcrumb-menu">
|
||||||
|
<li><a href="<?php echo e(route('index')); ?>">صفحه اصلی</a></li>
|
||||||
|
<li class="active"><?php echo $__env->yieldContent('title'); ?></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="user-profile py-120">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-3">
|
||||||
|
<?php echo $__env->make('account.layouts.sidebar', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-9">
|
||||||
|
<?php echo $__env->yieldContent('account-content'); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\ASUS\Desktop\airline-agency\resources\views/account/layouts/app.blade.php ENDPATH**/ ?>
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
<div class="listing-content">
|
<div class="listing-content">
|
||||||
<div class="listing-slider owl-carousel owl-theme" dir="ltr">
|
<div class="listing-slider owl-carousel owl-theme" dir="ltr">
|
||||||
<?php if($tour->coverImage?->file): ?>
|
<?php if($tour->images && $tour->images->count() > 0): ?>
|
||||||
<img src="<?php echo e(getFileUrl($tour->coverImage->file_id)); ?>"
|
<?php if($tour->images->count() > 1): ?>
|
||||||
class="w-100 h-100"
|
<?php $__currentLoopData = $tour->images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
alt="<?php echo e($tour->title); ?>">
|
<img src="<?php echo e(getFileUrl($image->file_id)); ?>" alt="<?php echo e($tour->flight_number); ?>">
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<img src="<?php echo e(asset('assets/Admin/images/tour/single-2.jpg')); ?>"
|
<img src="<?php echo e(getFileUrl($tour->images->first()->file_id)); ?>" alt="<?php echo e($tour->flight_number); ?>">
|
||||||
class="w-100 h-100"
|
<?php endif; ?>
|
||||||
alt="<?php echo e($tour->title); ?>">
|
<?php else: ?>
|
||||||
|
<img src="<?php echo e(asset('assets/img/flight/single-1.jpg')); ?>" alt="<?php echo e($tour->flight_number); ?>">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,259 @@
|
|||||||
|
<?php $__env->startSection('title' , 'ویرایش پروفایل'); ?>
|
||||||
|
|
||||||
|
<?php $__env->startSection('account-content'); ?>
|
||||||
|
<div class="user-profile-wrapper">
|
||||||
|
|
||||||
|
<?php if(session('success')): ?>
|
||||||
|
<div class="col-lg-12 mb-3">
|
||||||
|
<div class="alert alert-success"><?php echo e(session('success')); ?></div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if(session('error')): ?>
|
||||||
|
<div class="col-lg-12 mb-3">
|
||||||
|
<div class="alert alert-danger"><?php echo e(session('error')); ?></div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div class="col-lg-12 mb-4">
|
||||||
|
<div class="user-profile-card">
|
||||||
|
<h4 class="user-profile-card-title">بروزرسانی مشخصات پروفایل</h4>
|
||||||
|
<div class="user-profile-form">
|
||||||
|
<form action="<?php echo e(route('accounts.edit-profile.update')); ?>" method="POST" enctype="multipart/form-data">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>نام </label>
|
||||||
|
<input type="text" name="first_name" class="form-control"
|
||||||
|
value="<?php echo e(old('first_name', $user->first_name)); ?>" placeholder="نام شما">
|
||||||
|
<?php $__errorArgs = ['first_name'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="text-danger">
|
||||||
|
<?php echo e($message); ?>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>نام خانوادگی</label>
|
||||||
|
<input type="text" name="last_name" class="form-control"
|
||||||
|
value="<?php echo e(old('last_name', $user->last_name)); ?>" placeholder="نام خانوادگی">
|
||||||
|
<?php $__errorArgs = ['last_name'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger"><?php echo e($message); ?></span> <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>ایمیل</label>
|
||||||
|
<input type="text" name="email" class="form-control"
|
||||||
|
value="<?php echo e(old('email', $user->email)); ?>" placeholder="ایمیل">
|
||||||
|
<?php $__errorArgs = ['email'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="text-danger"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>موبایل</label>
|
||||||
|
<input type="text" name="mobile" class="form-control"
|
||||||
|
value="<?php echo e(old('mobile', $user->mobile)); ?>" placeholder="موبایل">
|
||||||
|
<?php $__errorArgs = ['mobile'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="text-danger"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>استان</label>
|
||||||
|
<select name="province_id" id="province_id" class="form-control">
|
||||||
|
<option value="">انتخاب استان</option>
|
||||||
|
<?php $__currentLoopData = $provinces; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $province): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<option value="<?php echo e($province->id); ?>"
|
||||||
|
<?php echo e(old('province_id', $user->province_id) == $province->id ? 'selected' : ''); ?>>
|
||||||
|
<?php echo e($province->name); ?>
|
||||||
|
|
||||||
|
</option>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['province_id'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="text-danger"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>شهر</label>
|
||||||
|
<select name="city_id" id="city_id" class="form-control">
|
||||||
|
<option value="">انتخاب شهر</option>
|
||||||
|
<?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<option value="<?php echo e($city->id); ?>"
|
||||||
|
<?php echo e(old('city_id', $user->city_id) == $city->id ? 'selected' : ''); ?>>
|
||||||
|
<?php echo e($city->name); ?>
|
||||||
|
|
||||||
|
</option>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['city_id'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="text-danger"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>عکس پروفایل</label>
|
||||||
|
<input type="file" name="avatar" class="form-control" accept="image/*">
|
||||||
|
<?php $__errorArgs = ['avatar'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="text-danger"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="theme-btn mt-4">آپدیت مشخصات پروفایل <i class="far fa-user"></i>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="user-profile-card">
|
||||||
|
<h4 class="user-profile-card-title">عوض کردن رمز عبور</h4>
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="user-profile-form">
|
||||||
|
<form action="<?php echo e(route('accounts.edit-profile.change-password')); ?>" method="POST">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>رمز عبور فعلی</label>
|
||||||
|
<input type="password" name="current_password" class="form-control"
|
||||||
|
placeholder="رمز عبور فعلی">
|
||||||
|
<?php $__errorArgs = ['current_password'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="text-danger"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>رمز عبور جدید</label>
|
||||||
|
<input type="password" name="new_password" class="form-control"
|
||||||
|
placeholder="رمز عبور جدید">
|
||||||
|
<?php $__errorArgs = ['new_password'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="text-danger"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>تکرار رمز عبور جدید</label>
|
||||||
|
<input type="password" name="new_password_confirmation" class="form-control"
|
||||||
|
placeholder="تکرار رمز عبور جدید">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit" class="theme-btn mt-4">
|
||||||
|
عوض کردن رمز عبور <i class="far fa-key"></i>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php $__env->startPush('scripts'); ?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('#province_id').on('change', function () {
|
||||||
|
let provinceId = $(this).val();
|
||||||
|
let citySelect = $('#city_id');
|
||||||
|
|
||||||
|
|
||||||
|
citySelect.html('<option value="">انتخاب شهر</option>');
|
||||||
|
|
||||||
|
|
||||||
|
if (provinceId) {
|
||||||
|
citySelect.html('<option value="">در حال بارگذاری شهرها...</option>');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "<?php echo e(url('/account/get-cities')); ?>/" + provinceId,
|
||||||
|
type: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
let options = '<option value="">انتخاب شهر</option>';
|
||||||
|
$.each(data, function (key, city) {
|
||||||
|
options += '<option value="' + city.id + '">' + city.name + '</option>';
|
||||||
|
});
|
||||||
|
citySelect.html(options);
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
citySelect.html('<option value="">خطا در دریافت لیست شهرها</option>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php $__env->stopPush(); ?>
|
||||||
|
|
||||||
|
<?php echo $__env->make('account.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\ASUS\Desktop\airline-agency\resources\views/account/edit-profile.blade.php ENDPATH**/ ?>
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<main class="main">
|
||||||
|
|
||||||
|
<div class="site-breadcrumb" style="background: url(assets/img/breadcrumb/02.jpg)">
|
||||||
|
<div class="container">
|
||||||
|
<h2 class="breadcrumb-title">ورود</h2>
|
||||||
|
<ul class="breadcrumb-menu">
|
||||||
|
<li><a href="<?php echo e(route('index')); ?>">صفحه اصلی</a></li>
|
||||||
|
<li class="active">ورود</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="login-area py-120">
|
||||||
|
<div class="container">
|
||||||
|
<div class="col-md-5 mx-auto">
|
||||||
|
<?php if($errors->has('general')): ?>
|
||||||
|
<span style="color: red">
|
||||||
|
<?php echo e($errors->first('general')); ?>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
<div class="login-form">
|
||||||
|
<div class="login-header">
|
||||||
|
<img src="assets/img/logo/logo-dark.png" alt>
|
||||||
|
<p>با حساب MyTrip خود وارد شوید</p>
|
||||||
|
</div>
|
||||||
|
<form action="<?php echo e(route('auth.login.post')); ?>" method="post">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>آدرس ایمیل</label>
|
||||||
|
<div class="form-group-icon">
|
||||||
|
<input type="email" name="email" class="form-control" placeholder="ایمیل خود را وارد کنید" value="<?php echo e(old('email')); ?>">
|
||||||
|
<i class="far fa-envelope"></i>
|
||||||
|
</div>
|
||||||
|
<?php $__errorArgs = ['email'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span style="color: red"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>رمز عبور</label>
|
||||||
|
<div class="form-group-icon">
|
||||||
|
<input type="password" name="password" class="form-control" placeholder="رمز عبور را وارد کنید">
|
||||||
|
<i class="far fa-lock"></i>
|
||||||
|
</div>
|
||||||
|
<?php $__errorArgs = ['password'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span style="color: red"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-between mb-3">
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value id="remember">
|
||||||
|
<label class="form-check-label" for="remember">
|
||||||
|
مرا به یاد داشته باش
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<a href="forgot-password.html" class="forgot-pass">رمز عبور را فراموش کرده اید؟</a>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<button type="submit" class="theme-btn"><i class="far fa-sign-in"></i> ورود</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div class="login-footer">
|
||||||
|
<div class="login-divider"><span>یا</span></div>
|
||||||
|
<p>اکانت ندارید ؟ <a href="<?php echo e(route('auth.register.index')); ?>">عضو شدن.</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
|
||||||
|
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\ASUS\Desktop\airline-agency\resources\views/auth/login.blade.php ENDPATH**/ ?>
|
||||||
@@ -3,10 +3,10 @@
|
|||||||
<?php if($flight->images && $flight->images->count() > 0): ?>
|
<?php if($flight->images && $flight->images->count() > 0): ?>
|
||||||
<?php if($flight->images->count() > 1): ?>
|
<?php if($flight->images->count() > 1): ?>
|
||||||
<?php $__currentLoopData = $flight->images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
<?php $__currentLoopData = $flight->images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
<img src="<?php echo e(asset($image->path)); ?>" alt="<?php echo e($flight->flight_number); ?>">
|
<img src="<?php echo e(getFileUrl($image->file_id)); ?>" alt="<?php echo e($flight->flight_number); ?>">
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<img src="<?php echo e(asset($flight->images->first()->path)); ?>" alt="<?php echo e($flight->flight_number); ?>">
|
<img src="<?php echo e(getFileUrl($flight->images->first()->file_id)); ?>" alt="<?php echo e($flight->flight_number); ?>">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<img src="<?php echo e(asset('assets/img/flight/single-1.jpg')); ?>" alt="<?php echo e($flight->flight_number); ?>">
|
<img src="<?php echo e(asset('assets/img/flight/single-1.jpg')); ?>" alt="<?php echo e($flight->flight_number); ?>">
|
||||||
|
|||||||
Reference in New Issue
Block a user