<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

use App\Models\Booking;

class BookingMail extends Mailable
{
    use Queueable, SerializesModels;
    public $bookingData;

    /**
     * Create a new message instance.
     */
    public function __construct(Booking $booking)
    {
        //
        $this->bookingData = $booking->load(['bookable', 'accommodation', 'room']);
    }

    public function build()
    {
        $companyInfo = \App\Models\CompanyInformation::first();
        
        return $this->subject("New Booking from Matergo Hotel")
                    ->view('emails.booking', [
                        'companyInfo' => $companyInfo
                    ]);
    }
}
