HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
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/ipsremont-demo/app/Services/Email/EmailsService.php
<?php


namespace App\Services\Email;

use App\Http\Requests\Email\IndexRequest;
use App\Models\Statuses;
use App\Repository\Email\EmailsRepository;
use App\Services\Status\StatusService;


class EmailsService
{
    protected EmailsRepository $repository;

    public function __construct()
    {
        $this->repository = new EmailsRepository();
    }

    public static function getById($id)
    {
        return EmailsRepository::getById($id);
    }

    public function search(IndexRequest $request)
    {
        return $this->repository->search($request);
    }

    public function save($data)
    {
        $this->repository->save($data);
    }

    public static function getUserEvents()
    {
        $events = [
            'password-recovery' => 'emails.password-recovery',
            'new-user' => 'emails.new-user',
            'edit-service' => 'emails.edit-service',
            'request-to-add-company' => 'emails.request-to-add-company',
            'company-activation' => 'emails.company-activation'
        ];

        return $events;
    }

    public static function getOrderEvents()
    {
        $events = StatusService::getOrderAllForEmail();
        $events['order-new-with-new-address'] = 'emails.order-new-with-new-address';
        $events['order-edit'] = 'emails.order-edit';

        return $events;
    }

    public static function getRepairEvents()
    {
        return StatusService::getRepairAllForEmail();
    }

    public static function getAddressEvents()
    {
        $events = [
            'new-address' => 'emails.new-address',
            'main-address-changed' => 'emails.main-address-changed',
        ];

        return $events;
    }

    public static function getActtcEvents()
    {
        $events = [
            'act-created' => 'emails.act-created',
            'act-edited' => 'emails.act-edited',
        ];

        return $events;
    }

    public static function getShipmentEvents()
    {
        return StatusService::getShipmentAllForEmail();
    }
}