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

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 KiB

View File

@@ -1,12 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<h1>404</h1>
</body>
</html>
@extends('client.raffles.layouts.app')
@section('content')
<div
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">
<!-- Monkey Illustration -->
<div class="relative">
<img src="{{ asset('raffles/assets/images/404/404.png') }}" alt="Monkey" class="animate-bounce" height="500px"
width="700px">
</div>
<!-- Button -->
<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 ">
@foreach ($firstCourse->custom as $index => $data)
<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="">
<img class="w-ful " src="{{ asset($firstCourse->images[$index]) }}" alt="">
</div>

View File

@@ -22,6 +22,11 @@ Route::middleware('guest')->group(function () {
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'])
->name('password.request');