Browse Source

Facade updates

Abhimanyu Sharma 8 years ago
parent
commit
ac0f803a1c

+ 1 - 1
src/Abhimanyu003/Conversion/Conversion.php

@@ -179,7 +179,7 @@ class Conversion
      * @param $unit
      * @return Conversion
      */
-    public function convert($quanity, $unit)
+    public static function convert($quanity, $unit)
     {
         return new Conversion($quanity, $unit);
     }

+ 0 - 17
src/Abhimanyu003/Conversion/ConversionFacade.php

@@ -1,17 +0,0 @@
-<?php namespace Abhimanyu003\Conversion;
-
-use Illuminate\Support\Facades\Facade;
-
-class ConversionFacade extends Facade
-{
-
-    /**
-     * Get the registered name of the component.
-     *
-     * @return string
-     */
-    protected static function getFacadeAccessor()
-    {
-        return 'conversion';
-    }
-}

+ 1 - 10
src/Abhimanyu003/Conversion/ConversionServiceProvider.php

@@ -1,6 +1,5 @@
 <?php namespace Abhimanyu003\Conversion;
 
-use Illuminate\Foundation\AliasLoader;
 use Illuminate\Support\ServiceProvider;
 
 class ConversionServiceProvider extends ServiceProvider
@@ -20,19 +19,11 @@ class ConversionServiceProvider extends ServiceProvider
      */
     public function register()
     {
-        $this->app['conversion'] = $this->app->share(function ($app) {
+        $this->app->bind('conversion', function ($app) {
             return new Conversion;
         });
     }
 
-    public function boot()
-    {
-        $this->package('abhimanyu003/conversion');
-        $this->app->booting(function () {
-            $loader = AliasLoader::getInstance();
-            $loader->alias('Conversion', 'Abhimanyu003\Conversion\ConversionFacade');
-        });
-    }
 
     /**
      * Get the services provided by the provider.