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/dceprojects.corals.io/Corals/modules/Timesheet/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/dceprojects.corals.io/Corals/modules/Timesheet/TimesheetServiceProvider.php
<?php

namespace Corals\Modules\Timesheet;

use Corals\Foundation\Facades\Actions;
use Corals\Foundation\Facades\Filters;
use Corals\Foundation\Shortcodes\Facades\Shortcode;
use Corals\Modules\Timesheet\Facades\Timesheet;
use Corals\Modules\Timesheet\Hooks\DashboardHook;
use Corals\Modules\Timesheet\Hooks\TimesheetHook;
use Corals\Modules\Timesheet\Models\Entry;
use Corals\Modules\Timesheet\Providers\TimesheetAuthServiceProvider;
use Corals\Modules\Timesheet\Providers\TimesheetObserverServiceProvider;
use Corals\Modules\Timesheet\Providers\TimesheetRouteServiceProvider;
use Corals\Modules\Timesheet\Widgets\DepartmentHoursChart;
use Corals\Modules\Timesheet\Widgets\LatestEntries;
use Corals\Modules\Timesheet\Widgets\ProjectHoursChart;
use Corals\Settings\Facades\Settings;
use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\ServiceProvider;

class TimesheetServiceProvider extends ServiceProvider
{
    protected $defer = true;

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

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

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

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

        $this->registerCustomFieldsModels();

    }

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

        $this->app->register(TimesheetRouteServiceProvider::class);
        $this->app->register(TimesheetAuthServiceProvider::class);
        $this->app->register(TimesheetObserverServiceProvider::class);
        $this->registerHooksAndWidget();

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

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


    protected function registerHooksAndWidget()
    {
        Shortcode::addWidget('Timesheet::latest_entries', LatestEntries::class);
        Shortcode::addWidget('Timesheet::projects_hours', ProjectHoursChart::class);
        Shortcode::addWidget('Timesheet::departments_hours', DepartmentHoursChart::class);

        Filters::add_filter('dashboard_content', [DashboardHook::class, 'statistics']);
        Actions::add_action('dashboard_scripts', [DashboardHook::class, 'dashboard_scripts']);
        Actions::add_action('show_navbar', [TimesheetHook::class, 'show_navbar']);
        Actions::add_action('display_profile', [TimesheetHook::class, 'display_profile']);

    }

}

Spamworldpro Mini