From 81bd9e65df98abea4b2e39fcab68d4bdafa55ba8 Mon Sep 17 00:00:00 2001 From: Ananth Date: Tue, 31 Jan 2017 12:36:43 +0530 Subject: [PATCH] ENHANCEMENT Update to compatable with Laravel 5.3, 5.2, 5.1 and 5.0 and 5.4 framework based applications. --- src/Facade/Thumbnail.php | 9 ++++++--- src/Thumbnail.php | 2 +- src/ThumbnailServiceProvider.php | 24 ++++++++++++++++++------ 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/Facade/Thumbnail.php b/src/Facade/Thumbnail.php index 32338d8..33c12e8 100644 --- a/src/Facade/Thumbnail.php +++ b/src/Facade/Thumbnail.php @@ -1,5 +1,8 @@ -app->singleton('thumbnail', function($app) { - return new Thumbnail; - }); + if (method_exists(\Illuminate\Foundation\Application::class, 'singleton')) { + $this->app->singleton('thumbnail', function($app) { + return new Thumbnail; + }); + } else { + $this->app['thumbnail'] = $this->app->share(function($app) { + return new Thumbnail; + }); + } } } // end of ThumbnailServiceProvider class -// end of file ThumbnailServiceProvider +// end of file ThumbnailServiceProvider.php