Set bindings to Laravel app.
493075
protected function bindToLaravelApp()
    {
        $this->bindSandbox();
        $this->bindSwooleTable();

        if ($this->isServerWebsocket) {
            $this->bindRoom();
            $this->bindWebsocket();
        }
    }
981363
protected function setViewHelpers()
    {
        $this->set('token', $this->app->make('token'));
        $this->set('form', $this->app->make('helper/form'));
        $this->set('ui', $this->app->make('helper/concrete/ui'));
        $this->set('resolverManager', $this->app->make(ResolverManagerInterface::class));
    }
184657
public function registerInterfaceBindings(Application $app)
    {
        $app->bind(ClientInterface::class, FluentClient::class);
        $app->bind(ScopeInterface::class, FluentScope::class);
        $app->bind(SessionInterface::class, FluentSession::class);
        $app->bind(AuthCodeInterface::class, FluentAuthCode::class);
        $app->bind(AccessTokenInterface::class, FluentAccessToken::class);
        $app->bind(RefreshTokenInterface::class, FluentRefreshToken::class);
    }
782456
protected function registerViewBindings()
    {
        $this->singleton('view', function ()
        {
            $this->configure('view');

            $this['config']['view.paths'] = [
                realpath(base_path('views')),
            ];
            
            return $this->loadComponent('view', 'Illuminate\View\ViewServiceProvider');
        });
    }
855828
protected function registerBindings(): void
    {
        $this->app->bind('algolia.connection', function (Container $app) {
            $manager = $app['algolia'];

            return $manager->connection();
        });

        $this->app->alias('algolia.connection', SearchClient::class);
    }
1282202
protected function registerRequestRebindHandler()
	{
		$this->app->rebinding('request', function($app, $request)
		{
			$request->setUserResolver(function() use ($app)
			{
				return $app['auth']->user();
			});
		});
	}
946902
protected function overrideLangJS(): void
    {
        // Bind the Laravel JS Localization command into the app IOC.
        $this->app->singleton('localization.js', function ($app) {
            $app = $this->app;
            $laravelMajorVersion = (int) $app::VERSION;

            $files = $app['files'];

            if ($laravelMajorVersion === 4) {
                $langs = $app['path.base'].'/app/lang';
            } elseif ($laravelMajorVersion === 5) {
                $langs = $app['path.base'].'/resources/lang';
            }
            $messages = $app['config']->get('localization-js.messages');
            $generator = new LangJsGenerator($files, $langs, $messages);

            return new LangJsCommand($generator);
        });

        // Bind the Laravel JS Localization command into Laravel Artisan.
        $this->commands('localization.js');
    }
901976
protected function startBindingsPlugin($app)
    {
        /* @var \Illuminate\Foundation\Application $app */
        $this->requiresPlugins(Commands::class, Events::class);

        $this->onRegister('bindings', function (Application $app) {

            // Container bindings and aliases
            $legacy = ! class_exists('Illuminate\Foundation\Application') || version_compare(\Illuminate\Foundation\Application::VERSION, '5.7.0', '<');
            if ($legacy) {
                foreach ($this->bindings as $binding => $class) {
                    $this->app->bind($binding, $class);
                }
            }

            foreach ($this->weaklings as $binding => $class) {
                $this->bindIf($binding, $class);
            }

            foreach ([ 'share' => $this->share, 'shared' => $this->shared ] as $type => $bindings) {
                foreach ($bindings as $binding => $class) {
                    $this->share($binding, $class, [], $type === 'shared');
                }
            }

            if ($legacy) {
                foreach ($this->singletons as $binding => $class) {
                    if ($this->strict && ! class_exists($class) && ! interface_exists($class)) {
                        throw new \Exception(get_called_class() . ": Could not find alias class [{$class}]. This exception is only thrown when \$strict checking is enabled");
                    }
                    $this->app->singleton($binding, $class);
                }
            }

            foreach ($this->aliases as $alias => $full) {
                if ($this->strict && ! class_exists($full) && ! interface_exists($full)) {
                    throw new \Exception(get_called_class() . ": Could not find alias class [{$full}]. This exception is only thrown when \$strict checking is enabled");
                }
                $this->app->alias($alias, $full);
            }
        });
    }
524870
private function bindModels()
    {
        $bindings = [
            'users'              => AuthContracts\User::class,
            'roles'              => AuthContracts\Role::class,
            'permissions'        => AuthContracts\Permission::class,
            'permissions-groups' => AuthContracts\PermissionsGroup::class,
        ];

        foreach ($bindings as $key => $contract) {
            $this->bind($contract, $this->config()->get("laravel-auth.$key.model"));
        }
    }
357114
def bind(cls, app, *paths, methods=None, name=None, router=None, view=None):
        """"""
        cls.app = app
        if cls.app is not None:
            for _, m in inspect.getmembers(cls, predicate=inspect.isfunction):
                if not hasattr(m, ROUTE_PARAMS_ATTR):
                    continue
                paths_, methods_, name_ = getattr(m, ROUTE_PARAMS_ATTR)
                name_ = name_ or ("%s.%s" % (cls.name, m.__name__))
                delattr(m, ROUTE_PARAMS_ATTR)
                cls.app.register(*paths_, methods=methods_, name=name_, handler=cls)(m)

        @coroutine
        @functools.wraps(cls)
        def handler(request):
            return cls().dispatch(request, view=view)

        if not paths:
            paths = ["/%s" % cls.__name__]

        return routes_register(
            app, handler, *paths, methods=methods, router=router, name=name or cls.name)
996518
protected function registerCustomBindings(): void
    {
        $entityServiceFactory = $this->app->make(IEntityServiceFactory::class);

        foreach (config('laravel_entity_services.bindings') as $className => $entityService) {
            $entityServiceFactory->register($className, $entityService);
        }
    }
133780
protected function registerRouteBindings()
    {
        Routes\Admin\UsersRoutes::bindings();
        Routes\Admin\RolesRoutes::bindings();
        Routes\Admin\PermissionsRoutes::bindings();
    }
1171063
private function rebindModels()
    {
        $config   = $this->config();
        $bindings = [
            [
                'abstract' => \Arcanesoft\Contracts\Auth\Models\User::class,
                'concrete' => $config->get('arcanesoft.auth.users.model'),
            ],[
                'abstract' => \Arcanesoft\Contracts\Auth\Models\Role::class,
                'concrete' => $config->get('arcanesoft.auth.roles.model'),
            ],[
                'abstract' => \Arcanesoft\Contracts\Auth\Models\Permission::class,
                'concrete' => $config->get('arcanesoft.auth.permissions.model'),
            ],[
                'abstract' => \Arcanesoft\Contracts\Auth\Models\PermissionsGroup::class,
                'concrete' => $config->get('arcanesoft.auth.permissions-groups.model'),
            ],
        ];

        foreach ($bindings as $binding) {
            $this->bind($binding['abstract'], $binding['concrete']);
        }
    }
3868
def bind(self, flask_app, service, group=None):
        """"""
        if group not in self.services[service]:
            raise RuntimeError(
                'API group {} does not exist in service {}'.format(
                    group, service)
            )
        for name, api in self.services[service][group].items():
            # only bind APIs that have views associated with them
            if api.view_fn is None:
                continue
            if name not in flask_app.view_functions:
                flask_app.add_url_rule(
                    api.url, name, view_func=api.view_fn, **api.options)
1053525
protected function registerBindings(Application $app)
    {
        $app->bind('telegram.bot', function ($app) {
            $manager = $app['telegram'];

            return $manager->bot();
        });

        $app->alias('telegram.bot', Api::class);
    }
853810
protected function registerInterfaceBindings()
    {
        $this->app->singleton(LocaleRepositoryInterface::class, LocaleRepository::class);
        $this->app->singleton(MenuConfigInterpreterInterface::class, MenuConfigInterpreter::class);
        $this->app->singleton(MenuModulesInterpreterInterface::class, MenuModulesInterpreter::class);
        $this->app->singleton(MenuPermissionsFilterInterface::class, MenuPermissionsFilter::class);

        return $this;
    }
480292
protected function registerBindings(Application $app) {
        $app->bind('bitbucket.connection', function ($app) {
            $manager = $app['bitbucket'];
            return $manager->connection();
        });
        $app->alias('bitbucket.connection', Api::class);
    }