Flarum\Foundation\Application::make PHP Method

make() public method

(Overriding Container::make)
public make ( string $abstract, array $parameters = [] ) : mixed
$abstract string
$parameters array
return mixed
    public function make($abstract, array $parameters = [])
    {
        $abstract = $this->getAlias($abstract);
        if (isset($this->deferredServices[$abstract])) {
            $this->loadDeferredProvider($abstract);
        }
        return parent::make($abstract, $parameters);
    }

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function getMiddleware(Application $app)
 {
     $pipe = new MiddlewarePipe();
     $path = parse_url($app->url(), PHP_URL_PATH);
     $errorDir = __DIR__ . '/../../error';
     if (!$app->isInstalled()) {
         $app->register('Flarum\\Install\\InstallServiceProvider');
         $pipe->pipe($path, $app->make('Flarum\\Http\\Middleware\\StartSession'));
         $pipe->pipe($path, $app->make('Flarum\\Http\\Middleware\\DispatchRoute', ['routes' => $app->make('flarum.install.routes')]));
         $pipe->pipe($path, new HandleErrors($errorDir, true));
     } elseif ($app->isUpToDate() && !$app->isDownForMaintenance()) {
         $pipe->pipe($path, $app->make('Flarum\\Http\\Middleware\\ParseJsonBody'));
         $pipe->pipe($path, $app->make('Flarum\\Http\\Middleware\\StartSession'));
         $pipe->pipe($path, $app->make('Flarum\\Http\\Middleware\\RememberFromCookie'));
         $pipe->pipe($path, $app->make('Flarum\\Http\\Middleware\\AuthenticateWithSession'));
         $pipe->pipe($path, $app->make('Flarum\\Http\\Middleware\\SetLocale'));
         event(new ConfigureMiddleware($pipe, $path, $this));
         $pipe->pipe($path, $app->make('Flarum\\Http\\Middleware\\DispatchRoute', ['routes' => $app->make('flarum.forum.routes')]));
         $pipe->pipe($path, new HandleErrors($errorDir, $app->inDebugMode()));
     } else {
         $pipe->pipe($path, function () use($errorDir) {
             return new HtmlResponse(file_get_contents($errorDir . '/503.html', 503));
         });
     }
     return $pipe;
 }
All Usage Examples Of Flarum\Foundation\Application::make