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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

namespace Corals\Modules\Medad;

use Corals\Foundation\Facades\Actions;
use Corals\Foundation\Facades\Filters;
use Corals\Modules\Medad\Classes\MedadHooks;
use Corals\Modules\Medad\Facades\Medad;
use Corals\Modules\Medad\Models\Company;
use Corals\Modules\Medad\Notifications\AddCompanyRelationNotification;
use Corals\Modules\Medad\Notifications\DeliveryNoteDeliveredNotification;
use Corals\Modules\Medad\Notifications\DeliveryNoteStartNotification;
use Corals\Modules\Medad\Notifications\DeliveryNoteSubmittedNotification;
use Corals\Modules\Medad\Notifications\InviteNewCompanyNotification;
use Corals\Modules\Medad\Notifications\InvoicePaidNotification;
use Corals\Modules\Medad\Notifications\NewCompanyCreatedNotification;
use Corals\Modules\Medad\Notifications\PurchaseOrderSubmittedNotification;
use Corals\Modules\Medad\Notifications\QuotationRequestPublishedNotification;
use Corals\Modules\Medad\Notifications\QuotationSubmittedNotification;
use Corals\Modules\Medad\Notifications\TransactionSubmittedNotification;
use Corals\Modules\Medad\Providers\MedadAuthServiceProvider;
use Corals\Modules\Medad\Providers\MedadObserverServiceProvider;
use Corals\Modules\Medad\Providers\MedadRouteServiceProvider;
use Corals\Modules\Utility\Facades\Utility;
use Corals\Settings\Facades\Settings;
use Corals\User\Communication\Facades\CoralsNotification;
use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\ServiceProvider;

class MedadServiceProvider extends ServiceProvider
{
    protected $defer = true;

    /**
     * Bootstrap the application events.
     *
     * @return void
     */

    public function boot()
    {
        // Load view
        $this->loadViewsFrom(__DIR__ . '/resources/views', 'Medad');

        // Load translation
        $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'Medad');

        // Load migrations
//        $this->loadMigrationsFrom(__DIR__ . '/database/migrations');

        $this->registerCustomFieldsModels();

        Filters::add_filter('get_roles_list_query', [MedadHooks::class, 'get_roles_list_query'], 5);
        Filters::add_filter('datatable_scopes_user', [MedadHooks::class, 'datatable_scopes_user'], 10);
        Actions::add_action('user_just_created', [MedadHooks::class, 'user_just_created'], 5);
        Actions::add_action('show_navbar', [MedadHooks::class, 'acting_as_page_header'], 5);

        Filters::add_filter('corals_middleware', [MedadHooks::class, 'usersCompanyConfirmed'],11);

        $this->addEvents();
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->mergeConfigFrom(__DIR__ . '/config/medad.php', 'medad');

        $this->app->register(MedadRouteServiceProvider::class);
        $this->app->register(MedadAuthServiceProvider::class);
        $this->app->register(MedadObserverServiceProvider::class);

        $this->app->booted(function () {
            $loader = AliasLoader::getInstance();
            $loader->alias('Medad', Medad::class);
        });

        Utility::addToUtilityModules('Medad');
    }

    protected function registerCustomFieldsModels()
    {
        Settings::addCustomFieldModel(Company::class);
    }

    protected function addEvents()
    {
        CoralsNotification::addEvent(
            'notifications.medad.quotation_request_published',
            'Quotation Request Notification for Owner',
            QuotationRequestPublishedNotification::class,
            'notifications.medad.quotation_request_published');

        CoralsNotification::addEvent(
            'notifications.medad.quotation_submitted',
            'Quotation Notification for Owner',
            QuotationSubmittedNotification::class,
            'notifications.medad.quotation_submitted');


        CoralsNotification::addEvent(
            'notifications.medad.added_company_relation',
            'Add Company Relation Notification',
            AddCompanyRelationNotification::class,
            'notifications.medad.added_company_relation');


        CoralsNotification::addEvent(
            'notifications.medad.new_company_created',
            'Add Company Notification',
            NewCompanyCreatedNotification::class,
            'notifications.medad.new_company_created');

        CoralsNotification::addEvent(
            'notifications.medad.purchase_order_submitted',
            'Purchase Order Notification for Owner',
            PurchaseOrderSubmittedNotification::class,
            'notifications.medad.purchase_order_submitted');

        CoralsNotification::addEvent(
            'notifications.medad.delivery_note_submitted',
            'Delivery Note Notification for Owner',
            DeliveryNoteSubmittedNotification::class,
            'notifications.medad.delivery_note_submitted');

        CoralsNotification::addEvent(
            'notifications.medad.delivery_note_started',
            'Delivery Note Started Notification',
            DeliveryNoteStartNotification::class,
            'notifications.medad.delivery_note_started');


        CoralsNotification::addEvent(
            'notifications.medad.delivery_note_delivered',
            'Delivery Note Delivered Notification',
            DeliveryNoteDeliveredNotification::class,
            'notifications.medad.delivery_note_delivered');

        CoralsNotification::addEvent(
            'notifications.medad.invoice_paid',
            'Invoices Notification for Owner',
            InvoicePaidNotification::class,
            'notifications.medad.invoice_paid');

        CoralsNotification::addEvent(
            'notifications.medad.transaction_submitted',
            'Transaction Notification for Owner',
            TransactionSubmittedNotification::class,
            'notifications.medad.transaction_submitted');

        CoralsNotification::addEvent(
            'notifications.medad.invite_new_company',
            'New Company Notification for Owner',
            InviteNewCompanyNotification::class,
            'notifications.medad.invite_new_company');
    }
}

Spamworldpro Mini