Perform the booting of the service.

@return \Illuminate\Foundation\Application

@example
<?php
$new = new ServiceProvider;
183532
public function boot()
    {
        $this->tryRequireHelpers(self::ON_BOOT);
        $this->tryRegisterProviders(self::ON_BOOT);

        // Events
        $events = $this->app->make('events');

        foreach ($this->listens() as $event => $listeners) {
            foreach ($listeners as $listener) {
                $events->listen($event, $listener);
            }
        }

        foreach ($this->subscribe as $subscriber) {
            $events->subscribe($subscriber);
        }

        // Publish
        if (null !== $this->rootDir) {
            $this->bootConfigFiles();
            foreach ($this->viewDirs as $dirName => $namespace) {
                $viewPath = $this->resolvePath('viewsPath', compact('dirName'));
                $this->loadViewsFrom($viewPath, $namespace);
                $this->publishes([$viewPath => $this->resolvePath('viewsDestinationPath', compact('namespace'))], 'views');
            }
            foreach ($this->assetDirs as $dirName => $namespace) {
                $this->publishes([$this->resolvePath('assetsPath', compact('dirName')) => $this->resolvePath('assetsDestinationPath', compact('namespace'))], 'public');
            }
            foreach ($this->migrationDirs as $dirPath) {
                $this->publishes([$this->getDatabasePath($dirPath) => $this->resolvePath('migrationDestinationPath')], 'database');
            }
            foreach ($this->seedDirs as $dirPath) {
                $this->publishes([$this->getDatabasePath($dirPath) => $this->resolvePath('seedsDestinationPath')], 'database');
            }
        }

        $this->tryRequireHelpers(self::ON_BOOTED);
        $this->tryRegisterProviders(self::ON_BOOTED);

        return $this->app;
    }
1004287
public function boot()
    {
        $this->registerPolicies();

        auth()->provider('eloquent.sharp', function($app, array $config) {
            return new EloquentSharpUserProvider($app['hash'], $config['model']);
        });
    }
872525
public function boot()
    {
        $this->app['auth']->extend('jwt', function ($app, $name, array $config) {
            $guard = new JWTGuard(
                $name,
                new JWTHelper(),
                $app['auth']->createUserProvider($config['provider']),
                $app['request']
            );

            $app->refresh('request', $guard, 'setRequest');

            // Return an instance of Illuminate\Contracts\Auth\Guard...
            return $guard;
        });
    }
1004601
public function boot()
    {
        if ($this->app->runningInConsole()) {
            $this->publishes([
                __DIR__.'/../config/db-snapshots.php' => config_path('db-snapshots.php'),
            ], 'config');
        }

        $this->app->bind(SnapshotRepository::class, function () {
            $diskName = config('db-snapshots.disk');

            $disk = app(Factory::class)->disk($diskName);

            return new SnapshotRepository($disk);
        });

        $this->app->bind('command.snapshot:create', Create::class);
        $this->app->bind('command.snapshot:load', Load::class);
        $this->app->bind('command.snapshot:delete', Delete::class);
        $this->app->bind('command.snapshot:list', ListSnapshots::class);

        $this->commands([
            'command.snapshot:create',
            'command.snapshot:load',
            'command.snapshot:delete',
            'command.snapshot:list',
        ]);
    }
1293207
public function boot()
    {
        $this->bootConfigFiles();
        $this->bootViews();
        $this->bootAssets();
        $this->bootMigrations();
        $this->bootSeeds();
        $this->requireHelpersFor('boot');

        return $this->app;
    }
831133
public function boot()
    {
        $this->loadTranslationsFrom(__DIR__ . '/../lang', 'image-validator');

        $messages = trans('image-validator::validation');

        $this->app->bind(ImageValidator::class, function($app) use ($messages) {
            $validator = new ImageValidator($app['translator'], [], [], $messages);

            if (isset($app['validation.presence'])) {
                $validator->setPresenceVerifier($app['validation.presence']);
            }

            return $validator;
        });

        $this->addNewRules();
    }
486236
public function boot()
    {
        $this->app->when(FacebookChannel::class)
            ->needs(Facebook::class)
            ->give(function () {
                $pageToken = config('services.facebook.page-token');

                return new Facebook($pageToken);
            });
    }
7179
public function boot()
    {
        $this->app->singleton('flasher', function () {
            return $this->app->make(Notifier::class);
        });

        Route::pushMiddlewareToGroup('web', ShareFlasherMessagesFromSession::class);
    }
971588
public function boot()
    {
        $this->publishes([
            $this->configPath => $this->app->configPath().'/fb-messenger.php',
        ], 'config');

        $this->publishes([
            $this->menuPath => $this->app->basePath().'/routes/menu.php',
        ], 'menu');

        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'laravel-fb-messenger');
        $this->publishes([__DIR__.'/../public' => $this->app->basePath().'/public/vendor'], 'public');

        if ($this->app['config']->get('fb-messenger.debug')) {
            $this->app->extend(ExceptionHandler::class, function ($exceptionHandler, $app) {
                $debug = $app->make(Debug::class);
                return new Handler($exceptionHandler, $debug);
            });
        }
    }
129187
public function boot()
    {
        $this->bootPublish();

        // Extends Url Generator
        $this->app->bind('url', function ($app) {
            return new UrlGenerator(
                $app['router']->getRoutes(),
                $app['request']
            );
        });
    }
559021
public function boot()
    {
        $this->registerPolicies();

        Gate::before(function (User $user, $ability) {
            return $user->isAdmin() ? true : null;
        });
    }
349036
public function boot()
    {
        $router = $this->app->make(Router::class);

        $router->bind('area', function($value) {
            return $this->app->make(AreaManagerContract::class)->getById($value);
        });

        $router->pushMiddlewareToGroup('web', AreaMiddleware::class);
    }
853193
public function boot()
    {
        // Loop the providers and register commands
        $providers = $this->container->providers(false);

        foreach ($providers as $provider) {
            if (method_exists($provider, 'commands')) {
                $this->registerCommands($provider->commands());
            }
        }
    }
178795
public function boot()
    {
        if ($this->booted) {
            return;
        }

        array_walk($this->serviceProviders, function($provider)
        {
            $this->bootProvider($provider);
        });

        $this->bootApplication();
    }
164141
public function boot()
    {
        Validator::extend('uuid', function ($attribute, $value, $parameters, $validator) {
            return Uuid::validate($value);
        });
    }
622137
public function boot()
    {
        $source = realpath(__DIR__.'/../../../config/cloudder.php');

        if (class_exists('Illuminate\Foundation\Application', false)) {
            $this->publishes([$source => config_path('cloudder.php')]);
        }
        $this->mergeConfigFrom($source, 'cloudder');

        $this->app['JD\Cloudder\Cloudder'] = function ($app) {
            return $app['cloudder'];
        };
    }
15794
public function boot()
    {
        $this->mergeConfigFrom($this->configPath(), 'iplimit');
        $this->loadMigrationsFrom(__DIR__.'/database/migrations');
        $this->app->singleton(IpLimitService::class, function ($app) {
            return new IpLimitService($app['config']->get('iplimit'));
        });
    }