1 | <?php namespace Cornford\Bootstrapper; |
||
5 | class BootstrapServiceProvider extends ServiceProvider { |
||
6 | |||
7 | /** |
||
8 | * Indicates if loading of the provider is deferred. |
||
9 | * |
||
10 | * @var bool |
||
11 | */ |
||
12 | protected $defer = true; |
||
13 | |||
14 | /** |
||
15 | * Bootstrap the application events. |
||
16 | * |
||
17 | * @return void |
||
18 | */ |
||
19 | public function boot() |
||
20 | { |
||
21 | $assetPath = __DIR__.'/../../../public'; |
||
22 | $this->publishes([$assetPath => public_path('packages/cornford/bootstrapper')], 'bootstrapper'); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Register the service provider. |
||
27 | * |
||
28 | * @return void |
||
29 | */ |
||
30 | public function register() |
||
31 | { |
||
32 | $this->app->singleton('bootstrap', function($app) |
||
33 | { |
||
34 | return new Bootstrap( |
||
35 | $this->app->make('Illuminate\Html\FormBuilder', ['csrfToken' => $app['session.store']->getToken()]), |
||
36 | $this->app->make('Illuminate\Html\HtmlBuilder'), |
||
37 | $this->app->make('Illuminate\Http\Request') |
||
38 | ); |
||
39 | }); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * Get the services provided by the provider. |
||
44 | * |
||
45 | * @return string[] |
||
46 | */ |
||
47 | public function provides() |
||
51 | |||
52 | } |
||
53 |