Skip to content

Commit

Permalink
ENHANCEMENT
Browse files Browse the repository at this point in the history
Update to compatable with Laravel 5.3, 5.2, 5.1 and 5.0 and 5.4 framework based applications.
  • Loading branch information
Ananth committed Jan 31, 2017
1 parent 616ef8f commit 81bd9e6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
9 changes: 6 additions & 3 deletions src/Facade/Thumbnail.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?php namespace Lakshmajim\Thumbnail\Facade;

<?php

namespace Lakshmajim\Thumbnail\Facade;

// Inlcude namespace
use Illuminate\Support\Facades\Facade;

/**
* Thumbnail - Facade to support integration with Laravel framework
*
* @author lakshmaji
* @package Thumbnail
* @version 1.4.1
* @version 1.4.2
* @since Class available since Release 1.0.0
*/
class Thumbnail extends Facade {
Expand Down
2 changes: 1 addition & 1 deletion src/Thumbnail.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @author lakshmaji
* @package Thumbnail
* @version 1.4.1
* @version 1.4.2
* @since Class available since Release 1.0.0
*/
class Thumbnail
Expand Down
24 changes: 18 additions & 6 deletions src/ThumbnailServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php

// Define namespace
namespace Lakshmajim\Thumbnail;

// Include namespace
use Illuminate\Support\ServiceProvider;


Expand All @@ -15,7 +17,7 @@
*
* @author lakshmaji
* @package Thumbnail
* @version 1.4.1
* @version 1.4.2
* @since Class available since Release 1.0.0
*/
class ThumbnailServiceProvider extends ServiceProvider
Expand All @@ -33,15 +35,25 @@ public function boot()
/**
* Register the application services.
*
* @return void
* @return void
* @author lakshmaji
* @package Thumbnail
* @version 1.4.2
* @since Method available since Release 1.0.0
*/
public function register()
{
$this->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

0 comments on commit 81bd9e6

Please sign in to comment.