Ejemplo n.º 1
0
 protected function registerResource($key, $model)
 {
     $app = $this->app;
     $namespaceCompiler = new NamespaceCompiler($model->getName());
     $className = $namespaceCompiler->getName();
     $app['model.' . $key] = $app->share(function ($app) use($className) {
         return new $className();
     });
 }
Ejemplo n.º 2
0
 protected function registerRepository($key, $repository)
 {
     $app = $this->app;
     $namespaceCompiler = new NamespaceCompiler($repository->getName());
     $className = $namespaceCompiler->getName();
     $app['repository.eloquent.' . $key] = $app->share(function ($app) use($className, $key) {
         return new $className($app, $app['model.eloquent.' . $key], $app['contenttypes']->get($key));
     });
 }