Register the Swift Mailer instance.

@return void
545158
public function registerSwiftMailer()
    {
        $this->registerSwiftTransport();

        // Once we have the transporter registered, we will register the actual Swift
        // mailer instance, passing in the transport instances, which allows us to
        // override this transporter instances during app start-up if necessary.
        $this->app->singleton('swift.mailer', function ($app) {
            return new Swift_Mailer($app['swift.transport']->driver());
        });
    }
828319
protected function registerContactMailer()
    {
        $this->app->bind('contact.mailer', function ($app) {
            $mail = $app['mailer'];
            $home = $app['url']->to('/');
            $path = $app['config']['contact.path'];
            $email = $app['config']['contact.email'];
            $name = $app['config']['app.name'];

            return new Mailer($mail, $home, $path, $email, $name);
        });

        $this->app->alias('contact.mailer', Mailer::class);
    }
1066373
protected function registerSwiftMailer()
    {
        $this->registerSwiftTransport();
        $this->mailer = $this->getDI()->get('\Swift_Mailer', [$this->transport]);
    }
555017
protected function registerNewsletterService(){

        $this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterInterface', function()
        {
            return new \designpond\newsletter\Newsletter\Repo\NewsletterEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter );
        });
    }
1295451
protected function registerTypesService(){

        $this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterTypesInterface', function()
        {
            return new \designpond\newsletter\Newsletter\Repo\NewsletterTypesEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_types );
        });
    }
689534
public function register()
    {
        /* Services */
        $this->app->singleton(
            \LaravelRocket\Foundation\Services\MailServiceInterface::class,
            \LaravelRocket\Foundation\Services\Production\MailService::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Services\ImageServiceInterface::class,
            \LaravelRocket\Foundation\Services\Production\ImageService::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Services\LanguageServiceInterface::class,
            \LaravelRocket\Foundation\Services\Production\LanguageService::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Services\SlackServiceInterface::class,
            \LaravelRocket\Foundation\Services\Production\SlackService::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Services\FileUploadServiceInterface::class,
            \LaravelRocket\Foundation\Services\Production\FileUploadService::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Services\FileUploadS3ServiceInterface::class,
            \LaravelRocket\Foundation\Services\Production\FileUploadS3Service::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Services\FileUploadLocalServiceInterface::class,
            \LaravelRocket\Foundation\Services\Production\FileUploadLocalService::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Services\ExportServiceInterface::class,
            \LaravelRocket\Foundation\Services\Production\ExportService::class
        );

        /* Helpers */
        $this->app->singleton(
            \LaravelRocket\Foundation\Helpers\DateTimeHelperInterface::class,
            \LaravelRocket\Foundation\Helpers\Production\DateTimeHelper::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Helpers\LocaleHelperInterface::class,
            \LaravelRocket\Foundation\Helpers\Production\LocaleHelper::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Helpers\URLHelperInterface::class,
            \LaravelRocket\Foundation\Helpers\Production\URLHelper::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Helpers\CollectionHelperInterface::class,
            \LaravelRocket\Foundation\Helpers\Production\CollectionHelper::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Helpers\StringHelperInterface::class,
            \LaravelRocket\Foundation\Helpers\Production\StringHelper::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Helpers\PaginationHelperInterface::class,
            \LaravelRocket\Foundation\Helpers\Production\PaginationHelper::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Helpers\TypeHelperInterface::class,
            \LaravelRocket\Foundation\Helpers\Production\TypeHelper::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Helpers\RedirectHelperInterface::class,
            \LaravelRocket\Foundation\Helpers\Production\RedirectHelper::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Helpers\DataHelperInterface::class,
            \LaravelRocket\Foundation\Helpers\Production\DataHelper::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Helpers\FileHelperInterface::class,
            \LaravelRocket\Foundation\Helpers\Production\FileHelper::class
        );

        $this->app->singleton(
            \LaravelRocket\Foundation\Helpers\ArrayHelperInterface::class,
            \LaravelRocket\Foundation\Helpers\Production\ArrayHelper::class
        );

        //Commands
        $this->app->singleton('command.rocket.export.table', function($app) {
            return new ExportTableToFile($app['files']);
        });

        $this->app->singleton('command.rocket.import.file', function($app) {
            return new ImportFileToTable($app['files']);
        });

        $this->app->singleton('command.rocket.set.name', function($app) {
            return new SetAppName($app['files']);
        });

        $this->commands('command.rocket.export.table', 'command.rocket.import.file', 'command.rocket.set.name');
    }
28362
public function register()
    {
        $this->app->bind(LaravelSweetAlert::class, function ($app) {
            return new LaravelSweetAlert();
        });

        $this->app->alias(LaravelSweetAlert::class, 'laravel-sweet-alert');
    }
1308382
public function registerSwiftMailer()
    {
        $this->registerSwiftTransport();

        // Once we have the transporter registered, we will register the actual Swift
        // mailer instance, passing in the transport instances, which allows us to
        // override this transporter instances during app start-up if necessary.
        $this->app->singleton('swift.mailer', function () {
            if ($domain = $this->app->make('config')->get('mail.domain')) {
                Swift_DependencyContainer::getInstance()
                                ->register('mime.idgenerator.idright')
                                ->asValue($domain);
            }

            return new Swift_Mailer($this->app['swift.transport']->driver());
        });
    }
264708
public function register()
    {
        $this->registerRouter();
        $this->registerUrlGenerator();
        $this->registerRedirector();
        $this->registerPsrRequest();
        $this->registerPsrResponse();
        $this->registerResponseFactory();
        $this->registerControllerDispatcher();
    }
751277
public function register()
    {
        $this->loadModel('User.Users');
        $this->Users->fieldable(false);
        $user = $this->Users->newEntity();
        $registered = false;
        $languages = LocaleToolbox::languagesList();

        if ($this->request->data()) {
            $user->set('status', 0);
            $user->accessible(['id', 'token', 'status', 'last_login', 'created', 'roles'], false);
            $user = $this->Users->patchEntity($user, $this->request->data);

            if ($this->Users->save($user)) {
                NotificationManager::welcome($user)->send();
                $this->Flash->success(__d('user', 'Account successfully created, further instructions have been sent to your e-mail address.', ['key' => 'register']));
                $registered = true;
            } else {
                $this->Flash->danger(__d('user', 'Account could not be created, please check your information.'), ['key' => 'register']);
            }
        }

        $this->title(__d('user', 'Registration'));
        $this->set(compact('registered', 'user', 'languages'));
    }
807938
protected function registerMailer(): void
    {
        $this->app->singleton('orchestra.mail', function ($app) {
            $mailer = new Mailer($app, $transport = new TransportManager($app));

            if ($app->bound('orchestra.platform.memory')) {
                $mailer->attach($memory = $app->make('orchestra.platform.memory'));
                $transport->setMemoryProvider($memory);
            }

            if ($app->bound('queue')) {
                $mailer->setQueue($app->make('queue'));
            }

            return $mailer;
        });
    }
313278
public function register()
    {
        $this->mergeConfigFrom(
            __DIR__.'/config/newsletter.php', 'newsletter'
        );

        // Custom Facade for CampagneWorker
        $this->app['newsworker'] = $this->app->share(function ()
        {
            return $this->app->make('\designpond\newsletter\Newsletter\Worker\CampagneInterface');
        });

        $this->registerMailjetService();
        $this->registerMailjetNewService();
        $this->registerNewsletterService();
        $this->registerContentService();
        $this->registerTypesService();
        $this->registerCampagneService();
        $this->registerCampagneWorkerService();
        $this->registerInscriptionService();
        $this->registerSubscribeService();
        $this->registerImportService();
        $this->registerUploadService();
        $this->registerListService();
        $this->registerEmailService();
        $this->registerClipboardService();
        $this->registerSubscribeWorkerService();
    }
836323
public function register()
	{
        $this->app->bind('vextSchema', function() {
            return new VextBuilder(Schema::getConnection());
        });

        $this->app->bind('vextValidate', function() {
            return new VextValidate();
        });

        $this->app->booting(function(){
            $loader = \Illuminate\Foundation\AliasLoader::getInstance();
            $loader->alias('VextSchema', 'Qlcorp\VextFramework\Facades\VextSchema');
            $loader->alias('VextValidate', 'Qlcorp\VextFramework\Facades\VextValidate');
        });

        $this->app->bindShared('command.migrate.generate', function($app) {
            $packagePath = $app['path.base'].'/vendor';
            $repository = $app['migration.repository'];
            $migrator = new VextMigrator($repository, $app['db'], $app['files']);
            return new GenerateModelsCommand($migrator, $packagePath);
        });

        $this->commands('command.migrate.generate');
	}
496427
protected function registerSupportedMailer()
    {
        $this->app->singleton('antares.support.mail', function ($app) {
            $this->registerSwiftMailer();

            $mailer = new Mailer(
                    $app->make('view'), $app->make('antares.swift.mailer'), $app->make('events')
            );
            if ($app->bound('queue')) {
                $mailer->setQueue($app->make('queue'));
            }
            $from   = $app->make('antares.memory')->make('primary')->get('email.from');
            $config = $app->make('config')->get('mail.from');


            $mailer->alwaysFrom(array_get($from, 'address', array_get($config, 'address')), array_get($from, 'name', array_get($config, 'name')));

            $to = $app->make('config')->get('mail.to');

            if (is_array($to) && isset($to['address'])) {
                $mailer->alwaysTo($to['address'], $to['name']);
            }

            return $mailer;
        });
    }
1276282
private function registerSwiftMailerAutoloader()
    {
        if ($this->swiftMailerPath === null)
            $this->swiftMailerPath = Yii::getPathOfAlias('vendor.swiftmailer.swiftmailer.lib');
        $path = realpath($this->swiftMailerPath);
        if (!$this->swiftMailerPath || !$path)
            throw new CException('The EmailManager.swiftMailerPath is invalid.');
        require_once($path . '/classes/Swift.php');
        Yii::registerAutoloader(array('Swift', 'autoload'), true);
        require_once($path . '/swift_init.php');
    }
1359255
public function register(Request $request, EventDispatcherInterface $dispatcher, TranslatorInterface $translator, UserPasswordEncoderInterface $encoder, \Swift_Mailer $mailer)
    {
        // Check Auth
        if ($this->checkAuth()) {
            return $this->redirectToRoute($this->getParameter('pd_user.login_redirect'));
        }

        // Check Disable Register
        if (!$this->getParameter('pd_user.user_registration')) {
            $this->addFlash('error', $translator->trans('security.registration_disable'));

            return $this->redirectToRoute('security_login');
        }

        // Create User
        $user = $this->getParameter('pd_user.user_class');
        $user = new $user();
        if (!$user instanceof UserInterface) {
            throw new InvalidArgumentException();
        }

        // Dispatch Register Event
        if ($response = $dispatcher->dispatch(UserEvent::REGISTER_BEFORE, new UserEvent($user))->getResponse()) {
            return $response;
        }

        // Create Form
        $form = $this->createForm($this->getParameter('pd_user.register_type'), $user, [
            'profile_class' => $this->getParameter('pd_user.profile_class')
        ]);

        // Handle Form Submit
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            // Get Doctrine
            $em = $this->getDoctrine()->getManager();

            // Encode Password
            $password = $encoder->encodePassword($user, $form->get('plainPassword')->getData());
            $user->setPassword($password);

            // User Confirmation
            if ($this->getParameter('pd_user.email_confirmation')) {
                // Disable User
                $user->setEnabled(false);

                // Create Confirmation Token
                if (empty($user->getConfirmationToken()) || null === $user->getConfirmationToken()) {
                    $user->createConfirmationToken();
                }

                // Send Confirmation Email
                $emailBody = [
                    'confirmationUrl' => $this->generateUrl('security_register_confirm',
                        ['token' => $user->getConfirmationToken()],
                        UrlGeneratorInterface::ABSOLUTE_URL),
                ];
                $this->sendEmail($user, $mailer, 'Account Confirmation', $emailBody, 'Register');
            } else {
                // Send Welcome
                if ($this->getParameter('pd_user.welcome_email')) {
                    $this->sendEmail($user, $mailer, 'Registration', 'Welcome', 'Welcome');
                }
            }

            // User Add Default Group
            if ($group = $this->getParameter('pd_user.default_group')) {
                $getGroup = $em->getRepository($this->getParameter('pd_user.group_class'))->find($group);
                if ((null !== $getGroup) and $getGroup instanceof GroupInterface) {
                    $user->addGroup($getGroup);
                }
            }

            // Save User
            $em->persist($user);
            $em->flush();

            // Dispatch Register Event
            if ($response = $dispatcher->dispatch(UserEvent::REGISTER, new UserEvent($user))->getResponse()) {
                return $response;
            }

            // Register Success
            return $this->render($this->getParameter('pd_user.template_path') . '/Registration/registerSuccess.html.twig', [
                'user' => $user,
            ]);
        }

        // Render
        return $this->render($this->getParameter('pd_user.template_path') . '/Registration/register.html.twig', [
            'form' => $form->createView(),
        ]);
    }
906370
public function register()
    {

        $this->registerScheduler();
        $this->app['cart_instances'] =  [] ;

        $this->app->bind('cart', function($app, $params){
            $instance_name = !empty($params['name']) ? $params['name'] : 'default';
            $cart_instances = $app['cart_instances'];

            //implement singleton carts
            if(empty($cart_instances[$instance_name])){
                $model = config('cart.cart_model');
                $cart_instances[$instance_name] = $model::current($instance_name);
                $app['cart_instances'] = $cart_instances;
            }
            return $app['cart_instances'][$instance_name];
        });

        $this->publishes([
            __DIR__.'/config/cart.php' => config_path('cart.php'),
        ],'config');

        $this->publishes([
            __DIR__.'/database/migrations/' => database_path('migrations')
        ], 'migrations');

        $this->mergeConfigFrom(
            __DIR__.'/config/cart.php', 'cart'
        );
    }