git commit "fix user panel pages hero layout and add profile dropdown improvements"

This commit is contained in:
2026-08-17 16:34:14 +03:30
parent ea1a0cc0c4
commit 523c9d0396
21 changed files with 583 additions and 1356 deletions
+2 -2
View File
@@ -8,9 +8,9 @@ class CityController extends Controller
{
public function byProvince(int $province)
{
$cities = City::where('provinces', $province)
$cities = City::where('provinces_id', $province)
->orderBy('name')
->get(['id', 'name']);
->get();
return response()->json($cities);
}
+4 -2
View File
@@ -16,8 +16,10 @@ class CommentController extends Controller
->latest()
->paginate(4);
return view('account.users.comments.index',compact('comments'));
return view('account.users.comments.index', [
'comments' => $comments,
'withoutHero' => true
]);
}
public function store(CommentStoreRequest $request)
+5 -4
View File
@@ -14,10 +14,11 @@ class FavoriteController extends Controller
->latest()
->get();
return view('account.users.favorite.index', compact('favorites'));
}
public function store(Request $request)
return view('account.users.favorite.index', [
'favorites' => $favorites,
'withoutHero' => true
]);
} public function store(Request $request)
{
Favorite::firstOrCreate([
'user_id' => auth()->id(),
+29 -13
View File
@@ -3,33 +3,49 @@
namespace App\Http\Controllers;
use App\Models\Flight;
use App\Models\Tour;
use Illuminate\Http\Request;
class FlightController extends Controller
{
public function index()
public function index(Request $request)
{
$newestFlight = Flight::
latest()
->applySearch()
->take(10)
$flights = Flight::latest()
->applySearch($request->all())
->paginate(10);
$newestFlight = Flight::latest()
->take(3)
->get();
$flights = Flight::latest()->
paginate(9);
return view('home.index', compact('newestFlight', 'flights'));
$newestTour = Tour::latest()
->take(3)
->get();
$tours = Tour::latest()
->paginate(10);
return view('flights.index', compact(
'flights',
'newestFlight',
'newestTour',
'tours'
));
}
public function show(Flight $flight)
public function show(Flight $flight)
{
$flight->increment('views');
$comments = $flight->comments()
->latest()
->latest()
->get();
return view('flights.show', compact('flight','comments'));
return view('flights.show', compact('flight', 'comments'));
}
}
}
+5 -6
View File
@@ -11,13 +11,12 @@ class HomeController extends Controller
public function index()
{
$newestFlight = Flight::
where('departure_date', '>=', now())
->orderBy('departure_date', 'asc')
->take(3)
->get();
orderBy('created_at', 'desc')
->paginate(1);
$newestTour = Tour::latest()
->take(10)
->get();
->paginate(2);
$flights = Flight::latest()
->paginate(5);
+2 -2
View File
@@ -50,10 +50,10 @@ class ProfileController extends Controller
$inputs['profile_image'] = $imageName;
}
$user->update($inputs);
$user->update($inputs);
return back()->with([
'success','اطلاعات کاربر با موفقیت ویرایش شد.'
'success'=>'اطلاعات کاربر با موفقیت ویرایش شد.'
]);
}
+2 -3
View File
@@ -10,12 +10,11 @@ class TourController extends Controller
{
$newestTour = Tour::with('travelType')
->latest()
->take(10)
->get();
->paginate(3);
$tours = Tour::with('travelType')
->latest()
->paginate(5);
->paginate(2);
return view('tours.index', compact('newestTour', 'tours'));
}
+2 -2
View File
@@ -104,12 +104,12 @@ class ProfileUpdateRequest extends FormRequest
'password' => [
'required',
'nullable',
'confirmed',
'min:8'
],
'current_password' => [
'required_with:new_password',
'nullable:new_password',
'current_password:web',
],