当前位置: 首页>>代码示例>>PHP>>正文


PHP App::register方法代码示例

本文整理汇总了PHP中Illuminate\Support\Facades\App::register方法的典型用法代码示例。如果您正苦于以下问题:PHP App::register方法的具体用法?PHP App::register怎么用?PHP App::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Facades\App的用法示例。


在下文中一共展示了App::register方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: boot

 public function boot()
 {
     // Service provider
     App::register('\\Maatwebsite\\Excel\\ExcelServiceProvider');
     // Register alias
     $alias = AliasLoader::getInstance();
     $alias->alias('Excel', '\\Maatwebsite\\Excel\\Facades\\Excel');
 }
开发者ID:janusnic,项目名称:Octobercms-Flexi-Excel-Exporter,代码行数:8,代码来源:Plugin.php

示例2: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     App::register(\EasySlug\EasySlug\EasySlugServiceProvider::class);
     $this->app->bindShared('command.forum.table', function ($app) {
         return new MigrateForumCommand();
     });
     $this->commands('command.forum.table');
     include __DIR__ . '/../routes.php';
 }
开发者ID:teranode,项目名称:forum,代码行数:14,代码来源:ForumServiceProvider.php

示例3: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     // Register the HtmlServiceProvider
     App::register(HtmlServiceProvider::class);
     // Add aliases to Form/Html Facade
     $loader = AliasLoader::getInstance();
     $loader->alias('Form', FormFacade::class);
     $loader->alias('HTML', HtmlFacade::class);
     // Add alias for datagrid
     $loader->alias('Datagrid', 'Aginev\\Datagrid\\Datagrid');
 }
开发者ID:dyankov91,项目名称:datagrid,代码行数:16,代码来源:DatagridServiceProvider.php

示例4: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     // Register the HtmlServiceProvider
     App::register('Illuminate\\Html\\HtmlServiceProvider');
     // Add aliases to Form/Html Facade
     $loader = AliasLoader::getInstance();
     $loader->alias('Form', 'Illuminate\\Html\\FormFacade');
     $loader->alias('HTML', 'Illuminate\\Html\\HtmlFacade');
     // Register the acl:fill-permissions command
     $this->app['acl:fill-permissions'] = $this->app->share(function ($app) {
         return new AclFill();
     });
     $this->commands('acl:fill-permissions');
 }
开发者ID:aginev,项目名称:acl,代码行数:19,代码来源:AclServiceProvider.php

示例5: boot

 public function boot()
 {
     App::register(\MatthC\Privileges\PrivilegesServiceProvider::class);
     App::register(\HieuLe\Active\ActiveServiceProvider::class);
     App::bind('Active', function () {
         return new \HieuLe\Active\Facades\Active();
     });
     $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'laradmin');
     $this->publishes([__DIR__ . '/../config/laradmin.php' => config_path('laradmin.php')]);
     $this->publishes([__DIR__ . '/../../public' => public_path('vendor/laradmin')], 'public');
     if (!$this->app->routesAreCached()) {
         require __DIR__ . '/../routes.php';
     }
 }
开发者ID:Matth--,项目名称:laradmin,代码行数:14,代码来源:LaradminServiceProvider.php

示例6: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->package('selmonal/imagemanager');
     $path = realpath(__DIR__ . "/../../views");
     // naming views
     View::addNamespace('SIM', $path);
     App::bind('Selmonal\\Imagemanager\\ImageRepositoryInterface', 'Selmonal\\Imagemanager\\EloquentImageRepository');
     // Intervention image manipulator
     App::register("Intervention\\Image\\ImageServiceProvider");
     $this->app->bind("Selmonal\\Imagemanager\\ImageManipulator", function () {
         $basePath = public_path() . Config::get("imagemanager::basePath");
         $sizes = Config::get("imagemanager::sizes");
         return new \Selmonal\Imagemanager\ImageManipulator($basePath, $sizes);
     });
 }
开发者ID:selmonal,项目名称:imagemanager,代码行数:20,代码来源:ImagemanagerServiceProvider.php

示例7: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //
     $app = $this->app;
     $app['social'] = $app->share(function ($app) {
         return new Social();
     });
     require __DIR__ . '/../../routes.php';
     require __DIR__ . '/../../filters.php';
     // Registramos el componente de twitter
     App::register('Thujohn\\Twitter\\TwitterServiceProvider');
     $this->app->bind('SocialTw', function ($app) {
         return new Twitter(Config::get('social::twitter'), $app['session.store']);
     });
 }
开发者ID:jsehersan,项目名称:social,代码行数:20,代码来源:SocialServiceProvider.php

示例8: boot

 /**
  * @return $this
  */
 public function boot()
 {
     if (!$this->_isBooted) {
         $this->loadViews();
         $this->loadTranslations();
         $this->loadAssets();
         $this->loadConfig();
         $serviceProviderPath = $this->getServiceProviderPath();
         if (is_file($serviceProviderPath)) {
             App::register($this->getNamespace() . '\\Providers\\ModuleServiceProvider');
         }
         $this->_isBooted = TRUE;
     }
     return $this;
 }
开发者ID:BlueCatTAT,项目名称:kodicms-laravel,代码行数:18,代码来源:ModuleContainer.php

示例9: registerCoreEventServiceProvider

 protected function registerCoreEventServiceProvider()
 {
     App::register(new CoreEventServiceProvider($this->app));
 }
开发者ID:hrobinson,项目名称:laravel-core,代码行数:4,代码来源:CoreServiceProvider.php

示例10: _before

 public function _before()
 {
     // We have a problem here in that foreach fixture,
     // from the traitsProvider() method, the _before()
     // and _after() method are invoked. This is painfully
     // slow.
     // Avoid traditional startup...
     //parent::_before();
     // Create faker if needed
     if (!isset($this->faker)) {
         $this->faker = FakerFactory::create();
     }
     // Start Laravel app.
     if (!$this->hasApplicationBeenStarted()) {
         $this->startApplication();
     }
     // Before we obtain it - we need to make a small configuration
     // because the test-fixtures in Orchestra doesn't contain it.
     // We are generating it here, more or less just like Laravel
     ConfigFacade::set('app.key', Str::random(32));
     // HOTFIX, see https://github.com/orchestral/testbench/pull/128
     // This can be removed again, when fixed by author
     if (!ConfigFacade::has('broadcasting.connections.null')) {
         ConfigFacade::set('broadcasting.connections.null', ['driver' => 'null']);
     }
     // HOTFIX, see https://github.com/orchestral/testbench/pull/129
     // This can be removed again, when fixed by author
     $providers = ConfigFacade::get('app.providers');
     if (!in_array(\Illuminate\Notifications\NotificationServiceProvider::class, $providers)) {
         App::register(\Illuminate\Notifications\NotificationServiceProvider::class);
     }
 }
开发者ID:aedart,项目名称:laravel-helpers,代码行数:32,代码来源:TraitsTest.php

示例11: registerMarketingEventServiceProvider

 protected function registerMarketingEventServiceProvider()
 {
     App::register(new MarketingEventServiceProvider($this->app));
 }
开发者ID:hrobinson,项目名称:laravel-marketing,代码行数:4,代码来源:MarketingServiceProvider.php


注:本文中的Illuminate\Support\Facades\App::register方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。