Enhance 404 error page with custom layout and image, add admin login routes

This commit is contained in:
2025-08-24 12:47:48 +05:45
parent 6d71fe4b4a
commit 6ef55240a0
5 changed files with 64 additions and 37 deletions

View File

@@ -131,7 +131,7 @@ class WebsiteController extends Controller
} }
public function careerSingle($id) public function careerSingle($id)
{ {
$data['career'] = Career::findorFail($id); $data['career'] = Career::findorFail($id);
@@ -272,61 +272,78 @@ class WebsiteController extends Controller
public function getCost(Request $request) public function getCost(Request $request)
{ {
$data['costss'] = $this->costCalculatorService->findAll($request); $costs = $this->costCalculatorService->findAll($request);
foreach ($data['costss'] as $value) {
$id = $value->id; if ($costs->isEmpty()) {
return view("client.raffles.errors.404");
} }
$id = $costs->last()->id;
$cost = CostCalculator::with([ $cost = CostCalculator::with([
'stayTypeLiving', 'stayTypeLiving',
'stayTypeAccomodation', 'stayTypeAccomodation',
'stayTypeOnetime', 'stayTypeOnetime',
'stayTypeService' 'stayTypeService'
])->findOrFail($id); ])->find($id);
$data['fee'] = Program::where('id', $request->program_id)->first();
$data['title'] = 'View Cost Calculation'; if (!$cost) {
$data['cost'] = $cost; return view("client.raffles.errors.404");
}
$program = Program::find($request->program_id);
if (!$program) {
return view("client.raffles.errors.404");
}
$getBreakdown = function ($stayTypeTitle) use ($cost) { $getBreakdown = function ($stayTypeTitle) use ($cost) {
$living = optional($cost->stayTypeLiving->firstWhere('title', $stayTypeTitle))->pivot; $living = optional($cost->stayTypeLiving->firstWhere('title', $stayTypeTitle))->pivot;
$accomodation = optional($cost->stayTypeAccomodation->firstWhere('title', $stayTypeTitle))->pivot; $accomodation = optional($cost->stayTypeAccomodation->firstWhere('title', $stayTypeTitle))->pivot;
$onetime = optional($cost->stayTypeOnetime->firstWhere('title', $stayTypeTitle))->pivot; $onetime = optional($cost->stayTypeOnetime->firstWhere('title', $stayTypeTitle))->pivot;
$service = optional($cost->stayTypeService->firstWhere('title', $stayTypeTitle))->pivot; $service = optional($cost->stayTypeService->firstWhere('title', $stayTypeTitle))->pivot;
return [ return [
'living' => [ 'living' => [
'monthly' => $living->monthly ?? 0, 'monthly' => $living->monthly ?? 0,
'yearly' => $living->yearly ?? 0, 'yearly' => $living->yearly ?? 0,
], ],
'accomodation' => [ 'accomodation' => [
'monthly' => $accomodation->monthly ?? 0, 'monthly' => $accomodation->monthly ?? 0,
'yearly' => $accomodation->yearly ?? 0, 'yearly' => $accomodation->yearly ?? 0,
], ],
'onetime' => [ 'onetime' => [
'visa' => $onetime->visa ?? 0, 'visa' => $onetime->visa ?? 0,
'biometrics' => $onetime->biometrics ?? 0, 'biometrics' => $onetime->biometrics ?? 0,
'sevis' => $onetime->sevis ?? 0, 'sevis' => $onetime->sevis ?? 0,
'application' => $onetime->application ?? 0, 'application' => $onetime->application ?? 0,
'total' => ($onetime->visa ?? 0) + ($onetime->biometrics ?? 0) + ($onetime->sevis ?? 0) + ($onetime->application ?? 0), 'total' => ($onetime->visa ?? 0) + ($onetime->biometrics ?? 0) + ($onetime->sevis ?? 0) + ($onetime->application ?? 0),
], ],
'service' => [ 'service' => [
'flight_ticket' => $service->flight_ticket ?? 0, 'flight_ticket' => $service->flight_ticket ?? 0,
'insurance' => $service->insurance ?? 0, 'insurance' => $service->insurance ?? 0,
'extra' => $service->extra ?? 0, 'extra' => $service->extra ?? 0,
'total' => ($service->flight_ticket ?? 0) + ($service->insurance ?? 0) + ($service->extra ?? 0), 'total' => ($service->flight_ticket ?? 0) + ($service->insurance ?? 0) + ($service->extra ?? 0),
] ]
]; ];
}; };
$data['breakdowns'] = [ $data = [
'alone' => $getBreakdown('Alone'), 'costs' => $costs,
'with_spouse' => $getBreakdown('With Spouse'), 'fee' => $program,
'with_spouse_and_child' => $getBreakdown('With Spouse and Child'), 'title' => 'View Cost Calculation',
'cost' => $cost,
'breakdowns' => [
'alone' => $getBreakdown('Alone'),
'with_spouse' => $getBreakdown('With Spouse'),
'with_spouse_and_child' => $getBreakdown('With Spouse and Child'),
],
]; ];
return view('client.raffles.pages.cost-result', $data); return view('client.raffles.pages.cost-result', $data);
} }
public function thankyouPage(Request $r) public function thankyouPage(Request $r)
{ {
$data = new \stdClass(); $data = new \stdClass();

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 KiB

View File

@@ -1,12 +1,17 @@
<!DOCTYPE html> @extends('client.raffles.layouts.app')
<html lang="en">
<head> @section('content')
<meta charset="UTF-8"> <div
<meta name="viewport" content="width=device-width, initial-scale=1.0"> class="min-h-screen flex flex-col items-center justify-center bg-gradient-to-b from-yellow-100 via-white to-yellow-50 px-6">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <!-- Monkey Illustration -->
<title>Document</title> <div class="relative">
</head> <img src="{{ asset('raffles/assets/images/404/404.png') }}" alt="Monkey" class="animate-bounce" height="500px"
<body> width="700px">
<h1>404</h1> </div>
</body> <!-- Button -->
</html> <a href="{{ url('/') }}"
class="mt-6 inline-block bg-yellow-400 text-gray-900 font-semibold px-6 py-3 rounded-2xl shadow-md hover:bg-yellow-500 transition duration-300">
🏠 Back to Home
</a>
</div>
@endsection

View File

@@ -20,7 +20,7 @@
<div class="row "> <div class="row ">
@foreach ($firstCourse->custom as $index => $data) @foreach ($firstCourse->custom as $index => $data)
<div class=" col col-md-3"> <div class=" col col-md-3">
<a href="course-finder.php" class=" course-box rounded-10 "> <a href="{{ route('program.coursefinder') }}" class=" course-box rounded-10 ">
<div class=""> <div class="">
<img class="w-ful " src="{{ asset($firstCourse->images[$index]) }}" alt=""> <img class="w-ful " src="{{ asset($firstCourse->images[$index]) }}" alt="">
</div> </div>

View File

@@ -22,6 +22,11 @@ Route::middleware('guest')->group(function () {
Route::post('login', [AuthenticatedSessionController::class, 'store']); Route::post('login', [AuthenticatedSessionController::class, 'store']);
Route::get('admin/login', [AuthenticatedSessionController::class, 'create'])
->name('admin.login');
Route::post('admin/login', [AuthenticatedSessionController::class, 'store']);
Route::get('forgot-password', [PasswordResetLinkController::class, 'create']) Route::get('forgot-password', [PasswordResetLinkController::class, 'create'])
->name('password.request'); ->name('password.request');