diff --git a/app/Http/Controllers/Account/CommentHistoryController.php b/app/Http/Controllers/Account/CommentHistoryController.php new file mode 100644 index 0000000..76b4c97 --- /dev/null +++ b/app/Http/Controllers/Account/CommentHistoryController.php @@ -0,0 +1,20 @@ +id()) + ->with(['tour', 'flight']) + ->latest() + ->paginate(10); + return view('account.comment-history', compact('comments')); + } +} diff --git a/app/Http/Requests/Auth/RegisterPostRequest.php b/app/Http/Requests/Auth/RegisterPostRequest.php index 45e6924..efa1283 100644 --- a/app/Http/Requests/Auth/RegisterPostRequest.php +++ b/app/Http/Requests/Auth/RegisterPostRequest.php @@ -76,10 +76,15 @@ class RegisterPostRequest extends FormRequest 'unique:App\Models\User', 'ir_mobile:zero' ], - 'password' => [ + 'current_password' => [ + 'required', + 'current_password', + ], + + 'new_password' => [ 'required', 'min:6', - 'confirmed' + 'confirmed', ], 'province_id' => [ 'nullable', diff --git a/app/Models/User.php b/app/Models/User.php index 6f3023f..5696d96 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -105,4 +105,9 @@ class User extends Authenticated { return $this->hasMany(Comment::class); } + + public function wishlists() + { + return $this->hasMany(Wishlist::class); + } } diff --git a/app/helpers/helpers.php b/app/helpers/helpers.php index cc13ada..627d5e8 100644 --- a/app/helpers/helpers.php +++ b/app/helpers/helpers.php @@ -8,3 +8,21 @@ if (!function_exists('getUserFullName')) { return $user->first_name . ' ' . $user->last_name; } } + +if (!function_exists('getFileUrl')) { + + function getFileUrl(?int $fileId): ?string + { + if (!$fileId){ + return null; + } + + $file = \App\Models\File::find($fileId); + + if (!$file) { + return null; + } + + return asset('storage/' . $file->path); + } +} diff --git a/group(function b/group(function new file mode 100644 index 0000000..e69de29 diff --git a/name('index') b/name('index') new file mode 100644 index 0000000..e69de29 diff --git a/name('orders') b/name('orders') new file mode 100644 index 0000000..e69de29 diff --git a/name('post') b/name('post') new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/account/comment-history.blade.php b/resources/views/account/comment-history.blade.php new file mode 100644 index 0000000..ea40632 --- /dev/null +++ b/resources/views/account/comment-history.blade.php @@ -0,0 +1,123 @@ +@extends('account.layouts.app') + +@section('title', 'نظرات من') + +@section('account-content') + + +
+ +
+ + + +
+ +
+ + +@endsection diff --git a/resources/views/account/setting.blade.php b/resources/views/account/setting.blade.php new file mode 100644 index 0000000..5c9e5a3 --- /dev/null +++ b/resources/views/account/setting.blade.php @@ -0,0 +1,154 @@ +@extends('account.layouts.app') + +@section('title' , 'تنظیمات') + +@section('account-content') +
+ + @error('success') + {{ $message }} + @enderror + +
+ +
+ +{{--
--}} +{{-- --}} +{{--
--}} +
+@endsection diff --git a/routes/web.php b/routes/web.php index f7376fc..fad6b76 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,6 +1,7 @@ name('account.')->middleware('auth')->group(function ( Route::get('profile', [ProfileController::class, 'index'])->name('profile'); - Route::get('booking', [BookingController::class, 'index'])->name('booking'); - - Route::get('wishlist', [WishlistController::class, 'index'])->name('wishlist'); - Route::prefix('edit-profile')->name('edit-profile.')->controller(EditProfileController::class)->group(function () { Route::get('/', 'index')->name('index'); - Route::post('/', 'post')->name('post'); + Route::put('/', 'post')->name('post'); }); + Route::get('booking', [BookingController::class, 'index'])->name('booking'); + + Route::get('wishlist', [WishlistController::class, 'index']) + ->name('wishlist'); + + Route::get( + 'wishlist/{type}/{id}', + [WishlistController::class, 'toggle'] + )->name('wishlist.toggle'); + + + Route::get('comments', [CommentHistoryController::class, 'index']) + ->name('comments'); + + });