![]() 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/rentpix.corals.io/Corals/modules/RentPix/ |
<?php namespace Corals\Modules\RentPix; use Corals\Foundation\Facades\Filters; use Corals\Foundation\Shortcodes\Facades\Shortcode; use Corals\Modules\RentPix\Facades\RentPix; use Corals\Modules\RentPix\Hooks\RentPixHooks; use Corals\Modules\RentPix\Models\Customer; use Corals\Modules\RentPix\Models\Driver; use Corals\Modules\RentPix\Models\Inspection; use Corals\Modules\RentPix\Models\RateCode; use Corals\Modules\RentPix\Models\Reservation; use Corals\Modules\RentPix\Models\Unit; use Corals\Modules\RentPix\Notifications\FailedInspectionCreatedNotification; use Corals\Modules\RentPix\Notifications\InspectionCreatedNotification; use Corals\Modules\RentPix\Notifications\InspectionSubmittedNotification; use Corals\Modules\RentPix\Notifications\LoginNotification; use Corals\Modules\RentPix\Providers\RentPixAuthServiceProvider; use Corals\Modules\RentPix\Providers\RentPixObserverServiceProvider; use Corals\Modules\RentPix\Providers\RentPixRouteServiceProvider; use Corals\Modules\Utility\Facades\Utility; use Corals\Settings\Facades\Settings; use Corals\User\Communication\Facades\CoralsNotification; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Foundation\AliasLoader; use Illuminate\Support\ServiceProvider; use Pawlox\VideoThumbnail\VideoThumbnailServiceProvider; class RentPixServiceProvider extends ServiceProvider { protected $defer = true; /** * Bootstrap the application events. * * @return void */ public function boot() { // Load view $this->loadViewsFrom(__DIR__ . '/resources/views', 'RentPix'); // Load translation $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'RentPix'); // Load migrations // $this->loadMigrationsFrom(__DIR__ . '/database/migrations'); Filters::add_filter('dashboard_content', [RentPixHooks::class, 'dashboard_content'], 8); $this->registerCustomFieldsModels(); $this->addEvents(); $this->registerWidgets(); $this->registerMorphMaps(); } /** * Register the service provider. * * @return void */ public function register() { $this->mergeConfigFrom(__DIR__ . '/config/rentPix.php', 'rentPix'); $this->app->register(RentPixRouteServiceProvider::class); $this->app->register(RentPixAuthServiceProvider::class); $this->app->register(RentPixObserverServiceProvider::class); $this->app->register(VideoThumbnailServiceProvider::class); $this->app->booted(function () { $loader = AliasLoader::getInstance(); $loader->alias('RentPix', RentPix::class); }); Utility::addToUtilityModules('RentPix'); } protected function registerCustomFieldsModels() { Settings::addCustomFieldModel(Inspection::class); Settings::addCustomFieldModel(Unit::class); } protected function addEvents() { CoralsNotification::addEvent( 'notifications.rentpix.inspection_created', 'Inspection Creation Notification', InspectionCreatedNotification::class, 'notifications.rentpix.inspection_created'); CoralsNotification::addEvent( 'notifications.rentpix.inspection_submitted', 'Inspection Submitted Notification', InspectionSubmittedNotification::class, 'notifications.rentpix.inspection_submitted'); CoralsNotification::addEvent( 'notifications.rentpix.login', 'Login Notification', LoginNotification::class, 'notifications.rentpix.login'); CoralsNotification::addEvent( 'notifications.rentpix.failed_inspection_created', 'Failed Inspection Creation Notification', FailedInspectionCreatedNotification::class, 'notifications.rentpix.failed_inspection_created'); } public function registerWidgets() { Shortcode::addWidget('OpenInspectionsCount', \Corals\Modules\RentPix\Widgets\OpenInspectionsCountWidget::class); Shortcode::addWidget('CompletedInspectionsCount', \Corals\Modules\RentPix\Widgets\CompletedInspectionsCountWidget::class); Shortcode::addWidget('UploadedPhotosCount', \Corals\Modules\RentPix\Widgets\UploadedPhotosCountWidget::class); Shortcode::addWidget('ReservationsInspected', \Corals\Modules\RentPix\Widgets\ReservationsInspectedWidget::class); Shortcode::addWidget('FailedInspectionsCount', \Corals\Modules\RentPix\Widgets\FailedInspectionsCountWidget::class); Shortcode::addWidget('LatestInspectionsWidget', \Corals\Modules\RentPix\Widgets\LatestInspectionsWidget::class); } protected function registerMorphMaps() { return; Relation::morphMap([ 'Reservation' => Reservation::class, 'Inspection' => Inspection::class, 'Unit' => Unit::class, 'Driver' => Driver::class, 'Customer' => Customer::class, 'RateCode' => RateCode::class ]); } }