Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Recca Tsai committed Aug 17, 2016
1 parent 96ea6df commit 35f0322
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/Facades/AjaxUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Recca0120\Upload\Facades;

use Illuminate\Support\Facades\Facade;
use Recca0120\Upload\Manager;

class AjaxUpload extends Facade
{
Expand All @@ -13,6 +14,6 @@ class AjaxUpload extends Facade
*/
protected static function getFacadeAccessor()
{
return 'ajaxupload';
return Manager::class;
}
}
6 changes: 1 addition & 5 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ class ServiceProvider extends BaseServiceProvider
*/
public function register()
{
$this->app->singleton('ajaxupload', function ($app) {
return new Manager($app);
});

$this->app->singleton(Manager::class, function ($app) {
return $this->app->make('ajaxupload');
return new Manager($app);
});
}
}
4 changes: 1 addition & 3 deletions tests/ServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ public function test_service_provider()
|------------------------------------------------------------
*/

$app
->shouldReceive('singleton')->with('ajaxupload', m::type(Closure::class))->once()
->shouldReceive('singleton')->with(Manager::class, m::type(Closure::class))->once();
$app->shouldReceive('singleton')->with(Manager::class, m::type(Closure::class))->once();

/*
|------------------------------------------------------------
Expand Down

0 comments on commit 35f0322

Please sign in to comment.