app->singleton('image', function ($app) { return new ImageHelper(); }); $this->app->singleton('theme', function ($app) use ($themeHelper) { return $themeHelper; }); $this->app->singleton('misc', function ($app) { return new MiscHelper(); }); $this->app->singleton('user_config', function ($app) { return new ConfigHelper(); }); Validator::extend('is_dir', (ValidationHelper::class . '@directoryExists')); Validator::extend('dir_empty', (ValidationHelper::class . '@isDirectoryEmpty')); Validator::extend('is_writeable', (ValidationHelper::class . '@isPathWriteable')); // Model observers Album::observe(AlbumObserver::class); Label::observe(LabelObserver::class); // Configure our default pager if (MiscHelper::isAppInstalled()) { LengthAwarePaginator::defaultView($themeHelper->viewName('partials.pager_links')); } // Set base URL variable (used in both the main app and the installer) $baseUrl = url('/'); if (!substr($baseUrl, strlen($baseUrl) - 1, 1) != '/') { $baseUrl .= '/'; } View::share('appBaseUrl', $baseUrl); } /** * Register any application services. * * @return void */ public function register() { // } }