Ejemplo n.º 1
0
 /**
  * @inheritDoc
  */
 public function register()
 {
     $this->mergeConfigFrom($this->configPath, 'ray_emitter');
     App::singleton('rayemitter.store', function () {
         return new Store();
     });
 }
Ejemplo n.º 2
0
 /**
  * @inheritDoc
  */
 public function register()
 {
     App::singleton('c4tech.upload', function () {
         $repo = Config::get('upload.repos.upload', 'C4tech\\Upload\\Repository');
         $repo = Config::get('foundation.repos.upload', $repo);
         return new $repo();
     });
 }
 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     //
     //require_once(__DIR__.'/Providers/Main.php');
     App::singleton('Happybirthday', function ($app) {
         return new Main();
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     App::singleton('mandrill.wrapper', function ($app) {
         $apikey = Config::get('laravel-mandrill-wrapper::apikey');
         $mandrill = new \Mandrill($apikey);
         return $mandrill;
     });
 }
Ejemplo n.º 5
0
 protected function prepareForTests()
 {
     parent::prepareForTests();
     App::singleton(UtilsServiceCatalog::ServerConfigurationService, 'StubServerConfigurationService');
     //Route::enableFilters();
     $this->current_realm = Config::get('app.url');
     $user = User::where('identifier', '=', 'sebastian.marcet')->first();
     $this->be($user);
     Session::start();
 }
Ejemplo n.º 6
0
 /**
  * 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();
     });
 }
Ejemplo n.º 7
0
 /**
  * @param Request $request
  * @param callable $next
  */
 public function handle(Request $request, Closure $next)
 {
     foreach ($request->all() as $parameterName => $value) {
         $keyClass = ucfirst($parameterName);
         if (!is_subclass_of($keyClass, K::class)) {
             continue;
         }
         $keyInstance = new $keyClass($value);
         App::singleton(K1::class, function () use($keyInstance) {
             return $keyInstance;
         });
     }
     return $next($request);
 }
Ejemplo n.º 8
0
 /**
  * @param Request $request
  * @param callable $next
  */
 public function handle(Request $request, Closure $next)
 {
     foreach ($request->route()->parameters() as $parameterName => $resourceId) {
         $resourceClassName = ucfirst($parameterName);
         if (!is_subclass_of($resourceClassName, MessagingResource::class)) {
             continue;
         }
         $resourceInstance = new $resourceClassName($resourceId);
         App::singleton(MessagingResource::class, function () use($resourceInstance) {
             return $resourceInstance;
         });
         //$request->route()->setParameter($parameterName, $resourceInstance);
     }
     return $next($request);
 }
 /**
  * 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']);
     });
 }
Ejemplo n.º 10
0
 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     App::singleton('Acl', function ($app) {
         return new Acl();
     });
 }
Ejemplo n.º 11
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     App::singleton('pusher', function ($app) {
         return new Pusher(new Client(), config('pusher.server_key'), config('pusher.batch_size'));
     });
 }