git commit "fix user panel pages hero layout and add profile dropdown improvements"
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -50,10 +50,10 @@ class ProfileController extends Controller
|
||||
$inputs['profile_image'] = $imageName;
|
||||
}
|
||||
|
||||
$user->update($inputs);
|
||||
$user->update($inputs);
|
||||
|
||||
return back()->with([
|
||||
'success','اطلاعات کاربر با موفقیت ویرایش شد.'
|
||||
'success'=>'اطلاعات کاربر با موفقیت ویرایش شد.'
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user