HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/demo.sports-crowd.com/app/Mail/TicketPurchaseEmailList.php
<?php

namespace App\Mail;

use App\Core\Parameter\Application\ParameterService;
use App\Core\Ticket\Application\TicketService;
use App\Http\Controllers\UtilController;
use App\Services\TicketParametersService;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Crypt;

class TicketPurchaseEmailList extends Mailable
{
    use Queueable, SerializesModels;
    public $ticket_main_id;
    public $match_event_id;
    public $user_data;
    public $user;
    public $url;
    public $pin;
    public $key;
    public $total_tickets;
    public $cryptoString;
    public $link;
    public $shortLink;
    public $title;
    public $invoice_link;
    public $view;
    public $event;
    public $appStoreUrl;
    public $playStoreUrl;
    public $enablePin = false;

    private $ticketService;
    private $ticketParametersService;
    private $parameterService;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($userTicketsToSendEmail, $ticket_main_id, $match_event_id, $user_data)
    {
        $this->title = 'Boletas ' . config('app.name');
        $this->ticketService = new TicketService();
        $this->ticketParametersService = new TicketParametersService();
        $this->parameterService = new ParameterService();
        if ($this->ticketParametersService->isStaticQRType()) {
            $this->ticket_main_id = $ticket_main_id;
            $this->match_event_id = $match_event_id;
            $this->user_data = $user_data;
            $this->total_tickets = $userTicketsToSendEmail->count();
            $this->invoice_link = $this->ticketService->getInvoiceLink($userTicketsToSendEmail[0]->code_ticket);
            $this->generateData();
            $this->view = 'mails.listTicketsCourtesy';
        } else {
            $this->user = $user_data;
            $this->event = $this->ticketService->getTicketByCodeTicket($userTicketsToSendEmail[0]->code_ticket)->match_event;
            $this->appStoreUrl = $this->parameterService->appStoreUrl();
            $this->playStoreUrl = $this->parameterService->playStoreUrl();
            $this->view = 'mails.ticket.buy-ticket';
        }
    }

    private function generateData()
    {
        $type = 'pdf';
        if ($this->total_tickets > config('app.maximum_pdf_tickets')) {
            $type = 'zip';
        }
        $this->cryptoString = Crypt::encryptString('type=' . $type . '&user_id=' . $this->user_data->id . '&match_event_id=' . $this->match_event_id . '&ticket_main_id=' . $this->ticket_main_id);
        $this->link = config('app.url') . '/download_ticket_for_user/' . $this->cryptoString;
        $util = new UtilController;
        $this->shortLink = $util->shorterUrl($this->link);
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->from('noreply@sports-crowd.com', 'Sports Crowd')->subject($this->title)->view($this->view);
    }
}