Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/medad.corals.io/Corals/modules/Medad/Notifications/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/medad.corals.io/Corals/modules/Medad/Notifications/DeliveryNoteStartNotification.php
<?php

namespace Corals\Modules\Medad\Notifications;

use Corals\Modules\Medad\Models\Branch;
use Corals\User\Communication\Classes\CoralsBaseNotification;

class DeliveryNoteStartNotification extends CoralsBaseNotification
{
    /**
     * @return mixed
     */
    public function getNotifiables()
    {
        $deliveryNote = $this->data['deliveryNote'];
        $adminsAndUsers = $deliveryNote->getNotifiables();

        if ($deliveryNote->supplierBranch) {
            $adminsAndUsers->merge($deliveryNote->supplierBranch->getNotifiables());
        } else {
            $branches = $deliveryNote->getBranchesRelatedSupplierCompany();

            if ($branches->isEmpty()) {
                foreach ($deliveryNote->supplierCompany->branches as $branch) {
                    $adminsAndUsers->merge($branch->getNotifiables());
                }
            } else {
                $branches = Branch::query()->whereIn('id', $branches->toArray());

                foreach ($branches as $branch) {
                    $adminsAndUsers->merge($branch->getNotifiables());
                }
            }
        }

        return $adminsAndUsers;
    }

    public function getNotificationMessageParameters($notifiable, $channel)
    {
        $deliveryNote = $this->data['deliveryNote'];

        return [
            'code' => $deliveryNote->present('code'),
            'status' => $deliveryNote->present('status'),
        ];
    }


    public static function getNotificationMessageParametersDescriptions()
    {
        return [
            'code' => 'Delivery Note submitted',
            'status' => trans('Corals::attributes.status'),
        ];
    }
}

Spamworldpro Mini