11<?php
22
3- namespace Webkod3r \ LaravelSwivel ;
3+ namespace LaravelSwivel ;
44
55use \Illuminate \Contracts \Container \Container ;
66use \Illuminate \Support \ServiceProvider ;
99
1010class LaravelSwivelServiceProvider extends ServiceProvider
1111{
12-
1312 /**
1413 * The package version.
1514 *
1615 * @var string
1716 */
18- const VERSION = '0.2.2 ' ;
17+ const VERSION = '1.0.1 ' ;
1918
2019 /**
2120 * Indicates if loading of the provider is deferred.
@@ -36,6 +35,21 @@ public function boot()
3635 $ this ->loadMigrationsFrom (__DIR__ . '/database/migrations ' );
3736 }
3837
38+ /**
39+ * Register the application services.
40+ *
41+ * @return void
42+ */
43+ public function register ()
44+ {
45+ $ this ->app ->singleton ('swivel ' , function (Container $ app ) {
46+ $ request = $ app ->make (\Illuminate \Http \Request::class);
47+ return new SwivelComponent ($ request );
48+ });
49+
50+ $ this ->app ->alias ('swivel ' , SwivelComponent::class);
51+ }
52+
3953 /**
4054 * Returns the configuration path for the component
4155 *
@@ -62,52 +76,16 @@ protected function setupConfig(Container $app)
6276 $ app ->configure ('swivel ' );
6377 }
6478
65- // merge specific configurations
66- $ source = $ app ->getConfigurationPath ('swivel ' ) ?: $ source ;
6779 $ this ->mergeConfigFrom ($ source , 'swivel ' );
6880 }
6981
70- /**
71- * Sets swivel configuration
72- *
73- * @return void
74- */
75- private function publishAssets ()
76- {
77- app ()->make ('config ' )->set ('swivel ' , app ()->getConfigurationPath ('swivel ' ));
78- app ()->configure ('swivel ' );
79- }
80-
81- /**
82- * @return void
83- */
84- public function register ()
85- {
86- $ this ->registerClass ();
87- }
88-
89- /**
90- * Register single service provider
91- *
92- * @return void
93- */
94- private function registerClass ()
95- {
96- $ this ->app ->singleton ('Swivel ' , function (Container $ app ) {
97- $ request = app (\Illuminate \Http \Request::class);
98- return new SwivelComponent ($ request );
99- });
100-
101- $ this ->app ->alias ('Swivel ' , SwivelComponent::class);
102- }
103-
10482 /**
10583 * Get the services provided by the provider.
10684 *
10785 * @return array
10886 */
10987 public function provides ()
11088 {
111- return ['Swivel ' ];
89+ return ['swivel ' ];
11290 }
11391}
0 commit comments