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/farmfun/reserveren.farmfun.be/app/Mail/SendProgramAdminMail.php
<?php

namespace App\Mail;

use App\Komma\Locations\Models\Location;
use App\Komma\Orders\Models\Order;
use App\Komma\Orders\OrderService;
use App\Komma\ShoppingCart\Interfaces\ShoppingCartInterface;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class SendProgramAdminMail extends Mailable
{
    use Queueable, SerializesModels;

    /** @var string */
    private $mailTo;

    /** @var string */
    private $mailedTo;

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

    /** @var Location */
    private $location;

    /** @var Location */
    private $link;

    public bool $savedToTeamleader;

    public array $messages;

    /**
     * SendProgramMail constructor.
     *
     * @param ShoppingCartInterface $cart
     * @param string $mailedTo
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
     */
    public function __construct(ShoppingCartInterface $cart, string $mailedTo, string $cartGenerationLink, bool $savedToTeamleader, array $messages)
    {
        /** @var OrderService $orderService */
        $orderService = app()->make(OrderService::class);
        $this->order = $orderService->createFakeOrderFromCart($cart);
        $this->location = $cart->getLocation();

        $this->link = $cartGenerationLink;
        $this->savedToTeamleader = $savedToTeamleader;
        $this->messages = $messages;

        $this->mailTo = site_config('mailTo');
        $this->mailedTo = $mailedTo;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->view('emails.admin.sendProgram')
            ->to($this->mailTo)
            ->subject('Gegenereerde offerte | Website')
            ->with([
                'mailedTo' => $this->mailedTo,
                'order' => $this->order,
                'cartLink' => $this->link,
                'location' => $this->location,
            ]);
    }
}