當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。