HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/farmfun.komma.pro/app/Mail/ResendReservationMail.php
<?php

namespace App\Mail;

use App\Komma\Orders\Models\Order;
use App\Komma\Orders\OrderService;
use App\Komma\Reservations\Models\Reservation;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\URL;

class ResendReservationMail extends Mailable
{
    use Queueable, SerializesModels;

    /** @var Reservation */
    private $reservation;

    /** @var Order */
    private $order;

    private $changeReservationUrl;

    /**
     * Create a new message instance.
     *
     * ResendReservationMail constructor.
     * @param Reservation $reservation
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
     */
    public function __construct(Reservation $reservation)
    {
        $this->reservation = $reservation;

        /** @var OrderService $orderService */
        $orderService = app()->make(OrderService::class);
        $this->order = $orderService->createFakeOrderFromReservation($reservation);

        $this->changeReservationUrl = URL::signedRoute('reservation.change', ['reservation' => $reservation->id]);

//        Log::warning(self::class . ': Mailed to ' . $this->reservation->email);
//        Log::info(config('mail'));
//        Log::info('');
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->view('emails.customer.resendReservation')
            ->to($this->reservation->email)
            ->subject(__('site/email.order_received.subject').' | '.config('site.company.name'))
            ->with([
                'reservation' => $this->reservation,
                'order' => $this->order,
                'changeReservationUrl' => $this->changeReservationUrl,
            ]);
    }
}