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/alq-cali.bikenow.co/app/Mail/TransferTicket.php
<?php

namespace App\Mail;

use App\Core\Parameter\Application\ParameterService;
use App\Core\Ticket\Application\TicketService;
use App\Core\Ticket\Application\TransferService;
use App\Core\User\Application\UserService;
use App\TicketUserLog;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class TransferTicket extends Mailable implements ShouldQueue
{
    use Queueable, SerializesModels;

    private $parameterService;
    private $ticketService;
    private $tranferService;
    private $userService;
    public $transferGroupId;
    public $newUser = false;
    public $time;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($transferGroupId)
    {
        $this->parameterService = new ParameterService();
        $this->ticketService = new TicketService();
        $this->tranferService = new TransferService();
        $this->userService = new UserService();
        $this->transferGroupId = $transferGroupId;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        $ticketUserLog = TicketUserLog::where('transfer_group', $this->transferGroupId)->first();
        if (!is_null($ticketUserLog->new_user_id)) {
            $recipient = $this->userService->find($ticketUserLog->new_user_id)->email;
        } else {
            $recipient = $ticketUserLog->email;
            $this->newUser = true;
        }
        $this->time = Carbon::parse($ticketUserLog->expires_at)->diffForHumans();

        return $this->from('noreply@sports-crowd.com', 'Sports Crowd')
            ->subject(__('transfer-ticket.email.subject'))
            ->view('mails.ticket.transfer-ticket')
            ->to($recipient)
            ->with('transfer', (object) ($ticketUserLog->toArray()))
            ->with('event', $this->ticketService->getTicketByTicketId($ticketUserLog->ticket_id)->match_event)
            ->with('zone', $this->ticketService->getTicketByTicketId($ticketUserLog->ticket_id)->zone)
            ->with('sender', $this->userService->find($ticketUserLog->previous_user_id))
            ->with('recipient', $recipient)
            ->with('appStoreUrl', $this->parameterService->appStoreUrl())
            ->with('playStoreUrl', $this->parameterService->playStoreUrl())
            ->with('count', $this->tranferService->countTicketsTransferByTransferGroup(
                $ticketUserLog->transfer_group
            ));
    }
}