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') + + +