diff --git a/app/Http/Controllers/CityController.php b/app/Http/Controllers/CityController.php index 67d37b5..339995a 100644 --- a/app/Http/Controllers/CityController.php +++ b/app/Http/Controllers/CityController.php @@ -3,11 +3,14 @@ namespace App\Http\Controllers; use App\Models\City; +use App\Models\Province; class CityController extends Controller { - public function byProvince($province) + public function byProvince( Province $province) { - return City::where('province_id', $province)->get(); + return response()->json( + $province->cities()->select('id', 'name')->get() + ); } } diff --git a/app/Models/Province.php b/app/Models/Province.php index 3603111..37e8455 100644 --- a/app/Models/Province.php +++ b/app/Models/Province.php @@ -34,7 +34,7 @@ class Province extends Model } public function cities() { - return $this->belongsTo(City::class); + return $this->hasMany(City::class); } } diff --git a/public/uploads/users/1787310773.jpg b/public/uploads/users/1787310773.jpg new file mode 100644 index 0000000..1c2daa2 Binary files /dev/null and b/public/uploads/users/1787310773.jpg differ diff --git a/public/uploads/users/1787372754.webp b/public/uploads/users/1787372754.webp new file mode 100644 index 0000000..53550ea Binary files /dev/null and b/public/uploads/users/1787372754.webp differ diff --git a/public/uploads/users/1787373663.webp b/public/uploads/users/1787373663.webp new file mode 100644 index 0000000..3789d37 Binary files /dev/null and b/public/uploads/users/1787373663.webp differ diff --git a/public/uploads/users/1787375691.jpg b/public/uploads/users/1787375691.jpg new file mode 100644 index 0000000..1c2daa2 Binary files /dev/null and b/public/uploads/users/1787375691.jpg differ diff --git a/resources/views/account/layout/app.blade.php b/resources/views/account/layout/app.blade.php index b83ab3c..573c749 100644 --- a/resources/views/account/layout/app.blade.php +++ b/resources/views/account/layout/app.blade.php @@ -20,7 +20,7 @@
- {{ $comment->tour->title ?? 'مورد حذف شده' }} + @if($comment->tour_id) + {{ $comment->tour->title ?? 'مورد حذف شده' }} + @elseif($comment->flight_id) + {{ $comment->flight->airline ?? 'مورد حذف شده' }} + @else + مورد حذف شده + @endif
{{ $comment->created_at->format('Y/m/d') }} diff --git a/resources/views/account/users/favorite/index.blade.php b/resources/views/account/users/favorite/index.blade.php index a4b6003..dbd65db 100644 --- a/resources/views/account/users/favorite/index.blade.php +++ b/resources/views/account/users/favorite/index.blade.php @@ -35,7 +35,11 @@ @if($favorite->favoritable_type == 'App\Models\Tour')- {{ $favorite->favoritable?->title ?? 'مورد حذف شده' }}
+ {{ $favorite->favoritable?->title ?? 'مورد حذف شده' }} + ++ {{ $favorite->favoritable?->summary ?? 'مورد حذف شده' }} +
تور @@ -44,7 +48,10 @@ @elseif($favorite->favoritable_type == 'App\Models\Flight')
- {{ $favorite->favoritable->name }} + {{ $favorite->favoritable->airline }} +
++ {{ $favorite->favoritable->flight_number }}
diff --git a/resources/views/account/users/profile/edit.blade.php b/resources/views/account/users/profile/edit.blade.php index 5035567..5230895 100644 --- a/resources/views/account/users/profile/edit.blade.php +++ b/resources/views/account/users/profile/edit.blade.php @@ -632,9 +632,8 @@ .append(''); $.ajax({ - url: "{{ route('users.cities.province', ':province') }}" + url: "{{ route('cities.province', ':province') }}" .replace(':province', provinceId), - type: 'GET', success: function (cities) { @@ -660,13 +659,9 @@ }, error: function () { - citySelect.empty(); - - citySelect.append( - '' - ); - + citySelect.append(''); + citySelect.prop('disabled', false); } }); diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 9044ec7..8478520 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -570,5 +570,42 @@