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


PHP App::bind方法代码示例

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


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

示例1: register

 /**
  * Register the service provider.
  */
 public function register()
 {
     App::bind('toolbox.commands.controllers', function () {
         return new \Impleri\Toolbox\Commands\ControllersCommand();
     });
     App::bind('toolbox.commands.models', function () {
         return new \Impleri\Toolbox\Commands\ModelsCommand();
     });
     App::bind('toolbox.commands.routes', function () {
         return new \Impleri\Toolbox\Commands\RoutesCommand();
     });
     App::bind('toolbox.commands.schema', function () {
         return new \Impleri\Toolbox\Commands\SchemaCommand();
     });
     App::bind('toolbox.commands.views', function () {
         return new \Impleri\Toolbox\Commands\ViewsCommand();
     });
     App::bind('toolbox.commands.build', function () {
         return new \Impleri\Toolbox\Commands\BuildCommand();
     });
     $this->commands($this->provides());
     // Subscribe our own commands to toolbox.compile
     Event::listen('toolbox.build', function ($app) {
         $app->call('toolbox:routes');
         $app->call('toolbox:controllers');
         $app->call('toolbox:models');
         $app->call('toolbox:schema');
         $app->call('toolbox:views');
     });
 }
开发者ID:impleri,项目名称:laravel-toolbox,代码行数:33,代码来源:ToolboxServiceProvider.php

示例2: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     $this->app->register('Intervention\\Image\\ImageServiceProvider');
     App::bind('Uploader', function ($app) {
         return new Uploader($app['request']);
     });
 }
开发者ID:aldozumaran,项目名称:uploader,代码行数:12,代码来源:UploaderServiceProvider.php

示例3: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     $this->mergeConfigFrom(__DIR__ . '/../../config/smsc.php', 'smsc');
     App::bind('smsc', function () {
         return new Smsc();
     });
 }
开发者ID:coder-studio,项目名称:smsc,代码行数:12,代码来源:SmscServiceProvider.php

示例4: register

 /**
  * Register any package services.
  *
  * @return void
  */
 public function register()
 {
     App::bind('VKAPI', function () {
         return new VKAPIClass(config('VKAPI.access_token'), config('VKAPI.version'), config('VKAPI.api_url'));
     });
     $this->publishes([__DIR__ . '/../config/VKAPI.php' => config_path('VKAPI.php')]);
 }
开发者ID:bafoed,项目名称:laravel-vkapi,代码行数:12,代码来源:VKAPIServiceProvider.php

示例5: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     $this->mergeConfigFrom(__DIR__ . '/../../config/yandexpdd.php', 'yandexpdd');
     App::bind('yandexpdd', function () {
         return new YandexPdd();
     });
 }
开发者ID:coder-studio,项目名称:yandexpdd,代码行数:12,代码来源:YandexPddServiceProvider.php

示例6: boot

 public function boot()
 {
     $this->package('mrosati84/laradmin');
     $prefix = Config::get('laradmin::prefix');
     $namespace = Config::get('laradmin::namespace');
     $entities = Config::get('laradmin::entities');
     foreach ($entities as $entity => $properties) {
         $fullClassName = $namespace . '\\' . $entity . 'Admin';
         $baseAdminController = 'Mrosati84\\Laradmin\\BaseAdminController';
         // register admin classes bindings
         App::bind($fullClassName, function () use($fullClassName, $entity) {
             return new $fullClassName($entity);
         });
         // register custom filters classes
         App::bind('AuthenticationFilter', 'Mrosati84\\Laradmin\\Filters\\AuthenticationFilter');
         // register custom route filters
         Route::filter('laradmin.auth', 'AuthenticationFilter');
         // register laradmin index route (just a redirect to default entity)
         Route::get($prefix, array('as' => 'laradmin.index', function () use($prefix) {
             return Redirect::route($prefix . '.' . strtolower(Config::get('laradmin::defaultEntity')) . '.index');
         }));
         // register entities routes
         Route::group(array('prefix' => $prefix, 'before' => 'laradmin.auth'), function () use($entity, $fullClassName) {
             Route::resource(strtolower($entity), $fullClassName);
         });
     }
 }
开发者ID:mrosati84,项目名称:laradmin,代码行数:27,代码来源:LaradminServiceProvider.php

示例7: register

 /**
  * Register any package services.
  *
  * @return void
  */
 public function register()
 {
     $this->mergeConfigFrom(__DIR__ . '/config/config.php', 'l5-sugarcrm');
     App::bind('sugarcrm', function () {
         return new SugarAPI();
     });
 }
开发者ID:daryllukas,项目名称:sugarcrm-v6.5-api-laravel,代码行数:12,代码来源:SugarAPIServiceProvider.php

示例8: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     App::bind('zendesk', function () {
         return new \Zendesk\Resource\Zendesk();
     });
     $this->mergeConfigFrom(__DIR__ . '/../config.php', 'zendesk-config');
 }
开发者ID:AramAnd,项目名称:tickets,代码行数:12,代码来源:ZendeskServiceProvider.php

示例9: register

 /**
  * Register any package services.
  *
  * @return void
  */
 public function register()
 {
     App::bind('citizen', function () {
         return new Citizen();
     });
     // use this if your package has a config file
     config(['config/erepapi.php']);
 }
开发者ID:darkmantle,项目名称:erepapi,代码行数:13,代码来源:ErepapiServiceProvider.php

示例10: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     $this->handleConfig();
     $this->registerEvents();
     $this->registerCommands();
     App::bind('slug', function ($app, $parameters) {
         return new \AlexeyMezenin\LaravelRussianSlugs\Slugs($parameters);
     });
 }
开发者ID:alexeymezenin,项目名称:laravel-russian-slugs,代码行数:14,代码来源:SlugsServiceProvider.php

示例11: boot

 /**
  * Register any other events for your application.
  *
  * @param  \Illuminate\Contracts\Events\Dispatcher $events
  * @return void
  */
 public function boot(DispatcherContract $events)
 {
     parent::boot($events);
     Log::info("Booting Datatext service");
     $this->publishes([__DIR__ . '/../database/migrations/' => database_path('migrations')], 'migrations');
     App::bind("datatext.user_provider", '\\Jvelo\\Datatext\\LaravelUserProvider');
     App::bind("datatext.assets_manager", '\\Jvelo\\Datatext\\Assets\\DefaultAssets');
     App::bind("datatext.shortcodes", '\\Jvelo\\Datatext\\Shortcodes\\Shortcodes');
     App::bind("datatext.api.pages", '\\Jvelo\\Datatext\\Api\\Pages');
 }
开发者ID:jvelo,项目名称:datatext,代码行数:16,代码来源:DatatextServiceProvider.php

示例12: registerModuleFacades

 /**
  * Registers the current Model and the current Controllers to the IoC.
  * Required for theirs facades
  */
 public function registerModuleFacades()
 {
     $className = ucfirst($this->module);
     App::bind('platform.core.module.model', function () use($className) {
         $modelName = 'Spescina\\PlatformCore\\Models\\' . $className;
         return new $modelName();
     });
     App::singleton('platform.core.module.controller', function () use($className) {
         $controllerName = 'Spescina\\PlatformCore\\Controllers\\' . $className . 'Controller';
         return new $controllerName();
     });
 }
开发者ID:spescina,项目名称:platform-core,代码行数:16,代码来源:Platform.php

示例13: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     $this->publishes([__DIR__ . '/migrations/' => database_path('/migrations')], 'migrations');
     $this->publishes([__DIR__ . '/config/mercadopago.php' => config_path('mercadopago.php')], 'config');
     $this->loadViewsFrom(__DIR__ . '/Views', 'MercadoPago');
     App::bind('mercadopago', function () {
         return new Mercadopago(config('services.mercadopago.CLIENT_ID'), config('services.mercadopago.CLIENT_SECRET'), config('services.mercadopago.SANDBOXMODE'));
     });
     //$routeConfig = [
     //    'namespace' => 'jorgelsaud\MercadoPago\Controllers',
     //    'prefix' => $this->app['config']->get('debugbar.route_prefix'),
     //];
     include __DIR__ . '/routes/routes.php';
 }
开发者ID:gustavoaragon,项目名称:mercadopagoLaravel,代码行数:19,代码来源:MercadoPagoServiceProvider.php

示例14: 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

示例15: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     // Register Package
     $this->package('j42/laravel-firebase', null, __DIR__ . '/../../../');
     // Get pseudo-connection from config
     $config = Config::get('database.connections.firebase');
     // Dependency Injection: Main Service
     App::singleton('firebase', function ($app) use($config) {
         return new Client($config);
     });
     // Dependency Injection: Token Provider
     App::bind('firebase.token', function ($app) use($config) {
         return new Token($config['token']);
     });
 }
开发者ID:janboden,项目名称:laravel-firebase,代码行数:20,代码来源:LaravelFirebaseServiceProvider.php


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