Exemplo n.º 1
0
 /**
  * Define the routes for the application.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function map(Cocona $cocona, Router $router)
 {
     $router->group(['namespace' => $this->namespace, 'prefix' => 'cocona'], function (Router $router) use($cocona) {
         $router->resource('example-resource', 'ResourceController');
         $router->controller('/', 'InstallController', ['getRequirements' => 'get.cocona.install.requirements', 'getDatabase' => 'get.cocona.install.database', 'getInstall' => 'get.cocona.install.install', 'getDone' => 'get.cocona.install.done']);
         if ($cocona->isInstalled()) {
             return;
         }
     });
 }
Exemplo n.º 2
0
 /**
  * @param Cocona $cocona
  * @param Dispatcher $events
  *
  * @return void
  */
 public function boot(Cocona $cocona, Dispatcher $events, Repository $config)
 {
     $config->push('twigbridge.extensions.enabled', 'TwigBridge\\Extension\\Laravel\\Form');
     $config->push('twigbridge.extensions.enabled', 'TwigBridge\\Extension\\Laravel\\Html');
     if (!$cocona->isInstalled()) {
         return;
     }
     $providers = [];
     foreach ($cocona->getPackages() as $package) {
         $providers[] = with(new $package->provider($this->app, $package->name))->register();
     }
     foreach ($providers as $provider) {
         $this->app->call([$provider, 'boot']);
     }
     $events->fire('cocona.booted');
 }