/** * @test */ public function testItPerformsABootMethod() { $this->applicationMock->shouldReceive('version')->once()->andReturn('5.2.6'); $this->applicationMock->shouldReceive('make')->once()->andReturn('fake_config_path'); $dispatcherMock = Mockery::mock(Dispatcher::class); $dispatcherMock->shouldReceive('listen')->once(); $this->serviceProvider->boot($dispatcherMock); }
/** * Bootstrap the application services. * * @return void */ public function boot(Router $router) { parent::boot($router); $this->loadViewsFrom(__DIR__ . '/views', 'construct'); $this->publishes([__DIR__ . '/AppController.php' => base_path('app/Http/Controllers/AppController.php'), __DIR__ . '/app.scss' => base_path('resources/assets/sass/app.scss'), __DIR__ . '/ie.scss' => base_path('resources/assets/sass/ie.scss'), __DIR__ . '/admin.js' => base_path('resources/assets/js/admin.js'), __DIR__ . '/svg' => base_path('resources/assets/svg'), __DIR__ . '/_settings.scss' => base_path('resources/assets/sass/_settings.scss'), __DIR__ . '/.gitignore.example' => base_path('.gitignore'), __DIR__ . '/bower.json' => base_path('bower.json'), __DIR__ . '/.bowerrc' => base_path('.bowerrc'), __DIR__ . '/package.json' => base_path('package.json'), __DIR__ . '/gulpfile.js' => base_path('gulpfile.js'), __DIR__ . '/settings.js' => base_path('settings.js'), __DIR__ . '/config/site.php' => config_path('site.php'), __DIR__ . '/config/mail.php' => config_path('mail.php'), __DIR__ . '/config/filesystems.php' => config_path('filesystems.php'), __DIR__ . '/database/migrations' => $this->app->databasePath() . '/migrations']); include __DIR__ . '/routes.php'; }
/** * Boot the service provider. * * This method is called after all other service providers have * been registered, meaning you have access to all other services * that have been registered by the framework. * * @return void */ public function boot(DispatcherContract $events) { parent::boot($events); // Publish the database migrations $this->publishes([__DIR__ . '/../database/migrations' => $this->app->databasePath() . '/migrations'], 'migrations'); $this->publishes([__DIR__ . '/../config' => config_path()], 'config'); // Log needs a closure as a listener Log::listen(function ($level, $message, $context) { // Throw out debug messages if we are not in debug mode if ($level == 'debug' && \Config::get('app.debug') != true) { return; } // Fetch the currently logged in user $username = ApplogHelper::currentUserName(); // Get the list of client IP addresses $clientIp = ApplogHelper::getClientIps(); // Split the log message to see how it is formatted. $logdata = explode(':', $message, 6); if (count($logdata) == 6) { list($classname, $traitname, $filename, $linenumber, $functionname, $message) = $logdata; } else { list($classname, $traitname, $filename, $linenumber, $functionname, $message) = ['', '', '', '', '', $message]; } // Store the log entry. try { Applog::create(['type' => $level, 'classname' => $classname, 'traitname' => $traitname, 'filename' => $filename, 'linenumber' => $linenumber, 'functionname' => $functionname, 'message' => $message, 'details' => json_encode($context), 'ipaddr' => $clientIp, 'created_by' => $username, 'updated_by' => $username]); } catch (\Exception $e) { // Do nothing } }); }
/** * Boot the service provider. * * This method is called after all other service providers have * been registered, meaning you have access to all other services * that have been registered by the framework. * * @return void */ public function boot(DispatcherContract $events) { parent::boot($events); // Publish the database migrations $this->publishes([__DIR__ . '/../database/migrations' => $this->app->databasePath() . '/migrations'], 'migrations'); $this->publishes([__DIR__ . '/../config' => config_path()], 'config'); }
/** * Bootstrap the application events. * * @return void */ public function boot() { parent::boot(); // @see https://coderwall.com/p/svocrg $this->package('npmweb/php-env-loader', null, __DIR__ . '/../../../'); $this->loadEnv(); }
public function boot(Dispatcher $events) { parent::boot($events); App::register('JLeonardoLemos\\Categories\\Providers\\RouteServiceProvider'); App::register('JLeonardoLemos\\Categories\\Providers\\EventServiceProvider'); $this->publishesMigrations(); }
/** * Boot the provider, adding the "gatekeeper" type to the Auth handling * * @param Router $router Laravel router instance */ public function boot(Router $router) { Auth::extend('gatekeeper', function ($app) { return new UserProvider(); }); parent::boot($router); }
/** * Bootstrap the application services. * * @return void */ public function boot(Router $router) { $router->bind('article', function ($id) { return \App\Article::where('slug', $id)->first(); }); parent::boot($router); }
/** * Bootstrap the application events. * * @return void */ public function boot() { parent::boot(); $this->package('edvinaskrucas/rbauth'); $this->extendAuth(); $this->registerFilters(); }
/** * Bootstrap the application services. * * @return void */ public function boot(Router $router) { parent::boot($router); $this->loadViewsFrom(__DIR__ . '/views', 'build'); $this->publishes([__DIR__ . '/app.scss' => base_path('resources/assets/sass/app.scss'), __DIR__ . '/app.scss' => base_path('resources/assets/sass/ie.scss'), __DIR__ . '/_settings.scss' => base_path('resources/assets/sass/_settings.scss'), __DIR__ . '/.gitignore.example' => base_path('.gitignore'), __DIR__ . '/bower.json' => base_path('bower.json'), __DIR__ . '/.bowerrc' => base_path('.bowerrc'), __DIR__ . '/package.json' => base_path('package.json'), __DIR__ . '/gulpfile.js' => base_path('gulpfile.js'), __DIR__ . '/settings.js' => base_path('settings.js'), __DIR__ . '/config/blog.php' => config_path('blog.php'), __DIR__ . '/config/mail.php' => config_path('mail.php'), __DIR__ . '/config/filesystems.php' => config_path('filesystems.php'), __DIR__ . '/database/migrations' => $this->app->databasePath() . '/migrations']); $this->publishes([__DIR__ . '/assets' => base_path('resources/assets/vendor/build')], 'publish'); include __DIR__ . '/routes.php'; }
/** * Send logs from the given level to Pushbullet. * * @return void */ public function boot() { parent::boot(); if (in_array(config('app.env'), (array) config('services.monobullet.env', config('app.env')))) { $monolog = Log::getMonolog(); $monolog->pushHandler(new PushbulletHandler(config('services.monobullet.token'), config('services.monobullet.recipients'), config('services.monobullet.level', Logger::INFO), config('services.monobullet.propagate', true))); } }
/** * Bootstrap any application services. * * @return void */ public function boot() { parent::boot(); \Blade::setRawTags("[[", "]]"); \Blade::setContentTags('<%', '%>'); // for variables and all things Blade \Blade::setEscapedContentTags('<%%', '%%>'); // for escaped data }
public function boot(Dispatcher $events) { # Call parent parent::boot($events); # Views $this->loadViewsFrom(__DIR__ . '/../View', 'install'); # Call Events $this->events($events); }
public function boot() { if (method_exists($this, 'package')) { $this->package('stevebauman/calendar-helper'); } else { $this::$configSeparator = '.'; $this->publishes([__DIR__ . '../../../config/config.php' => config_path('calendar-helper.php')], 'config'); $this->loadTranslationsFrom(__DIR__ . '../../../lang', 'calendar-helper'); } parent::boot(); }
/** * Boot the service provider. * * This method is called after all other service providers have * been registered, meaning you have access to all other services * that have been registered by the framework. * * @return void */ public function boot(DispatcherContract $events) { parent::boot($events); // Publish the database migrations and seeds $this->publishes([__DIR__ . '/../database/migrations' => $this->app->databasePath() . '/migrations'], 'migrations'); $this->publishes([__DIR__ . '/../database/seeds' => $this->app->databasePath() . '/seeds'], 'seeds'); $this->publishes([__DIR__ . '/../config' => config_path()], 'config'); // Register other providers required by this provider, which saves the caller // from having to register them each individually. $this->app->register(\Baum\Providers\BaumServiceProvider::class); $this->app->register(\Cviebrock\EloquentSluggable\SluggableServiceProvider::class); }
/** * Bootstrap any application services. * * @return void */ public function boot(DispatcherContract $events, Gate $gate) { $this->publishes([realpath(__DIR__ . '/../Database/Migrations') => $this->app->databasePath() . '/migrations'], 'migrations'); $this->publishes([__DIR__ . '/../Config' => config_path('larapress')], 'config'); if (!$this->app->routesAreCached()) { require __DIR__ . '/../Routes/routes.php'; } $this->loadViewsFrom(__DIR__ . '/../Resources/Views', 'larapress'); parent::boot($events); //roles $gate->policy(Portfolio::class, PortfolioPolicy::class); $events->listen(\Larapress\Portfolio\Events\PortfolioWasSaved::class, \Larapress\Portfolio\Listeners\TestListener::class); }
/** * Boot the service provider. * * This method is called after all other service providers have * been registered, meaning you have access to all other services * that have been registered by the framework. * * @return void */ public function boot(DispatcherContract $events) { parent::boot($events); // Publish the database migrations and seeders $this->publishes([__DIR__ . '/../database/migrations' => $this->app->databasePath() . '/migrations'], 'migrations'); $this->publishes([__DIR__ . '/../database/seeds' => $this->app->databasePath() . '/seeds'], 'seeds'); $this->publishes([__DIR__ . '/../config' => config_path()], 'config'); // Register other providers required by this provider, which saves the caller // from having to register them each individually. $this->app->register(\Delatbabel\SiteConfig\SiteConfigServiceProvider::class); $this->app->register(\Delatbabel\ViewPages\Providers\TwigBridgeServiceProvider::class); $this->app->register(\Delatbabel\ViewPages\Providers\IlluminateViewServiceProvider::class); }
/** * Bootstrap any application services. * * @return void */ public function boot(DispatcherContract $events, Gate $gate) { $this->publishes([realpath(__DIR__ . '/../Database/Migrations') => $this->app->databasePath() . '/migrations'], 'migrations'); $this->publishes([__DIR__ . '/../Config' => config_path('larapress')], 'config'); //the admin routess file if (!$this->app->routesAreCached()) { require __DIR__ . '/../Routes/routes.php'; } //register the packages views $this->loadViewsFrom(__DIR__ . '/../Resources/Views', 'larapress'); parent::boot($events); //register the events $events->listen(\Larapress\Pages\Events\PageWasSaved::class, \Larapress\Pages\Listeners\PageSavedListener::class); //register the authorization policies $gate->policy(Page::class, PagePolicy::class); }
public function boot(Router $router) { parent::boot($router); $this->artisanize(); $this->routerize($router); $this->loadViewsFrom(mkny_path() . '/Cinimod/resources/views', 'cinimod'); // $this->loadViewsFrom(resource_path('themes'), 'unicorn'); // $this->loadViewsFrom(mkny_path().'/Cinimod/resources/views'); $this->publishes([mkny_path() . '/Cinimod/resources/assets' => resource_path('assets/cinimod')]); // __DIR__.'/path/to/config/courier.php' => config_path('courier.php'), // $this->loadTranslationsFrom(mkny_app_path().'/resources/lang', 'cinimod'); // AliasLoader::getInstance()->alias('FormField', 'Way\Form\FormField'); // $loader = \Illuminate\Foundation\AliasLoader::getInstance(); // $loader->alias('Tools', 'Pulpitum\Core\Models\Tools'); // que locura ta isso ein! hahaha // }
/** * Perform post-registration booting of services. * * @return void */ public function boot() { $app = parent::boot(); $resolver = $this->app['view.engine.resolver']; $app = $this->app; $app->singleton('blade.compiler', function ($app) { $cache = $app['config']['view.compiled']; return new ModifiedBladeCompiler($app['files'], $cache); }); $resolver->register('blade', function () use($app) { return new ModifiedCompilerEngine($app['blade.compiler']); }); \App::bind('squeezer', function () { return new \Ardentic\Squeezer\Squeezer(); }); Squeezer::attach($this->app); }
public function boot(Router $router) { /* |-------------------------------------------------------------------------- | Publish package resources |-------------------------------------------------------------------------- */ $this->publishes([__DIR__ . '/public/assets' => public_path('assets/toolbox')], 'assets'); $this->publishes([__DIR__ . '/resources/migrations' => base_path('database/migrations')], 'migrations'); /* |-------------------------------------------------------------------------- | View path |-------------------------------------------------------------------------- */ $this->loadViewsFrom(__DIR__ . '/Views', 'admin'); /* |-------------------------------------------------------------------------- | View composer |-------------------------------------------------------------------------- */ view()->composer('*', function ($view) { $view->with('user', Auth::user()); }); /* |-------------------------------------------------------------------------- | Middleware |-------------------------------------------------------------------------- */ $router->middleware('auth', Authenticate::class); $router->middleware('logged', RedirectAuthenticated::class); /* |-------------------------------------------------------------------------- | Routes |-------------------------------------------------------------------------- */ $router->group(['middleware' => ['web'], 'prefix' => 'admin/'], function ($router) { $router->controller('auth', $this->namespace . 'AuthController'); $router->group(['middleware' => ['auth']], function ($router) { $router->any('{controller?}/{action?}/{id?}', function ($controller = 'home', $action = 'index', $id = null) { return \App::make($this->namespace . $controller . 'Controller')->callAction($action, [$id]); }); }); }); parent::boot($router); }
/** * Boot the provider, adding the "gatekeeper" type to the Auth handling * * @param Router $router Laravel router instance */ public function boot(Router $router) { // Add Gatekeeper to the Auth provider list Auth::extend('gatekeeper', function ($app) { return new UserProvider(); }); // Create a new "unique" (gkunique) validator for unique user checking Validator::extend('gk_unique', function ($attribute, $value, $parameters) { $type = isset($parameters[0]) ? $parameters[0] : 'user'; // strip a training "s" if there is one if (substr($type, -1) === 's') { $type = substr($type, 0, strlen($type) - 1); } $method = 'find' . ucwords($type) . 'By' . ucwords($attribute); try { $user = Gatekeeper::$method($value); return $user === false; } catch (\Exception $e) { return false; } }); parent::boot($router); }
/** * Bootstrap any application services. * * @return void */ public function boot(DispatcherContract $events, Gate $gate) { $this->publishes([realpath(__DIR__ . '/../Database/Migrations') => $this->app->databasePath() . '/migrations'], 'migrations'); $this->publishes([__DIR__ . '/../Resources/Assets' => resource_path('larapress')], 'assets'); $this->publishes([__DIR__ . '/../Resources/Public' => public_path('larapress')], 'public'); $this->publishes([__DIR__ . '/../Config' => config_path('larapress')], 'config'); if (!$this->app->routesAreCached()) { require __DIR__ . '/../Routes/routes.php'; } // Using Closure based composers... view()->composer('larapress::common.sidebar', function ($view) { return $view->with('menu', config('larapress.sidebar')); }); $this->loadViewsFrom(__DIR__ . '/../Resources/Views', 'larapress'); parent::boot($events); //events $events->listen(\Larapress\Pages\Events\PageWasSaved::class, \Larapress\Pages\Listeners\TestListener::class); //roles $gate->policy(Administrator::class, AdministratorPolicy::class); //console register $this->commands([\Larapress\Admin\Console\CreateAdministrator::class]); $this->commands([\Larapress\Admin\Console\CreateModel::class]); }
/** * Register any other events for your application * * @return void */ public function boot() { parent::boot(); $config = $this->app['config']; // Add the install wizard routes if asked to $loadDefaultRoutes = $config->get('install_wizard.routing.load_default'); if ($loadDefaultRoutes && !$this->app->routesAreCached()) { require $this->packageDir . '/src/routes.php'; } // Facade $this->app->singleton('InstallWizard', function ($app) { $wizard = new DefaultInstallWizard($app); return $wizard; }); $this->app->alias('InstallWizard', DefaultInstallWizard::class); // We have some views and translations for the wizard $this->loadViewsFrom($this->packageDir . '/resources/views', self::$RES_NAMESPACE); $this->loadTranslationsFrom($this->packageDir . '/resources/lang', self::$RES_NAMESPACE); // We publish some files to override if required $this->publishes([$this->packageDir . '/config/' . self::$CONFIG_FILE => config_path(self::$CONFIG_FILE)], 'config'); $this->publishes([$this->packageDir . '/resources/views' => resource_path('views/vendor/' . self::$RES_NAMESPACE)], 'views'); $this->publishes([$this->packageDir . '/resources/lang' => resource_path('lang/vendor/' . self::$RES_NAMESPACE)], 'translations'); $this->publishes([$this->packageDir . '/resources/assets' => public_path('vendor/' . self::$RES_NAMESPACE)], 'assets'); }
/** * Bootstrap the application events. * * @return void */ public function boot() { return $this->provider->boot(); }
public function boot(Request $request) { parent::boot(); // public = / App::instance('path.public', base_path()); Cache::extend('file', function ($app) { return new Utils\Adapters\Cache\CacheStore(); }); // If installed load module functions and set locale if (mw_is_installed()) { $modules = load_all_functions_files_for_modules(); $this->commands('Microweber\\Commands\\OptionCommand'); $language = get_option('language', 'website'); if ($language != false) { set_current_lang($language); } if ($this->app->runningInConsole()) { $this->commands('Microweber\\Commands\\UpdateCommand'); } } else { // Otherwise register the install command $this->commands('Microweber\\Commands\\InstallCommand'); } // Register routes $this->registerRoutes(); }
/** * Handle the booting of a deferred service provider. * * @param \Illuminate\Support\ServiceProvider $instance * @return void */ protected function setupDeferredBoot($instance) { if ($this->booted) { return $instance->boot(); } $this->booting(function () use($instance) { $instance->boot(); }); }
/** * Bootstrap the application services. * * @return void */ public function boot(DispatcherContract $events) { parent::boot(); $this->registerListenersAndSubsribers($events); $this->registerRepository(); }
/** * Sets up reference to config file. * * @return void */ public function boot() { parent::boot(); $this->package('npmweb/cdn-helper', null, __DIR__ . '/../../'); }
/** * Bootstrap any application services. * * @return void */ public function boot() { parent::boot(); \Blade::setRawTags('{{', '}}'); $this->cron(); }