/** * Get an instance of the possible current controller * being executed for the current route. * * @return mixed */ protected function getCurrentController() { $router = $this->app->make('router'); $route = $router->currentRouteAction(); if (($pos = strpos($route, '@')) !== false) { Controller::setFilterer($router); $controllerName = substr($route, 0, $pos); return $this->app[$controllerName]; } }
/** * Make a storage instance */ public function createStorage($save = false) { $storage = $this->app->make('oauth.storage'); if ($save) { $this->storage = $storage; } return $storage; }
/** * Creates the application. * * @return \Illuminate\Foundation\Application */ public function createApplication() { $app = new \Illuminate\Foundation\Application(dirname(dirname(__DIR__)) . '/vendor/laravel/laravel'); $app->singleton(\Illuminate\Contracts\Http\Kernel::class, \App\Http\Kernel::class); $app->singleton(\Illuminate\Contracts\Console\Kernel::class, \App\Console\Kernel::class); $app->singleton(\Illuminate\Contracts\Debug\ExceptionHandler::class, \App\Exceptions\Handler::class); $app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap(); return $app; }
/** * Returns ODM instance * @return Virgil\WebServices\RA\Providers\MongoObjectManager */ public function getDocumentManager() { return $this->app->make('Doctrine\\ODM\\MongoDB\\DocumentManager'); }