diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index aa46be0..622f6ba 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -160,14 +160,8 @@ public function submit(Request $request) return redirect()->back()->with('success', 'Thank you for your message!'); } - public function subscribe(Request $request) + public function show_order(Order $order): View { - // Validate the form data - $request->validate([ - 'email' => 'required|email|unique:subscribers', - ]); - - // Subscribe the user to the newsletter - dd('Subscribed'); + return view('orders.view', ['order' => $order]); } } diff --git a/resources/views/orders/view.blade.php b/resources/views/orders/view.blade.php new file mode 100644 index 0000000..39dee43 --- /dev/null +++ b/resources/views/orders/view.blade.php @@ -0,0 +1,110 @@ + +
+ +

+ + {{ __('Order Page') }} +

+
+
+
+
+
+

Order Details

+ +
+

Order Information

+

Title: {{ $order->title }}

+

Description: {{ $order->description }}

+

Status: {{ ucfirst($order->status) }}

+

Total Price: ${{ number_format($order->total_price, 2) }}

+
+ +
+

Attachments

+ @if ($order->attachments->isNotEmpty()) +
    +
    + @foreach($order->attachments as $attachment) +
    +
    + @if (in_array($attachment->type, ['image/jpeg', 'image/png', 'image/gif'])) + Attachment + @elseif ($attachment->type == 'application/pdf') +
    + +
    + @elseif ($attachment->type == 'application/zip' || $attachment->type == 'application/x-rar-compressed') +
    + +
    + @elseif (str_starts_with($attachment->type, 'video/')) +
    + +
    + @elseif (str_starts_with($attachment->type, 'audio/')) +
    + +
    + @else +
    + +
    + @endif + + + +
    +
    + @endforeach +
    +
+ @else +

No attachments available.

+ @endif +
+ +
+

Payment Information

+ @if ($order->isPaid()) +

Amount Paid: ${{ number_format($order->payment->amount, 2) }}

+

Payment Method: {{ ucfirst($order->payment->payment_method) }}

+

Payment Status: {{ ucfirst($order->payment->status) }} +

+ @else +

Payment not yet made.

+ @endif +
+ +
+

Delivery Information

+ @if ($order->delivery->isNotEmpty()) +
    + @foreach ($order->delivery as $delivery) +
  • {{ $delivery->details }}
  • + @endforeach +
+ @else +

Not yet delivered.

+ @endif +
+
+
+
+
+
+
diff --git a/routes/web.php b/routes/web.php index 61f5d87..eedbb80 100644 --- a/routes/web.php +++ b/routes/web.php @@ -29,6 +29,7 @@ Route::get('/dashboard', Dashboard::class)->name('dashboard'); Route::get('/messages', Messages::class)->name('messages'); Route::get('/orders', OrderShow::class)->name('orders.index'); + Route::get('/orders/{order}', [PagesController::class, 'show_order'])->name('orders.show'); // TODO: Fix the referral function system //Route::get('/referrals', Referrals::class)->name('referrals');