This repository has been archived by the owner on Aug 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for Laravel 5 while still keeping the backwards compat…
…ibility with Laravel 4. Fixes #10
- Loading branch information
Showing
5 changed files
with
105 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/Jelovac/Bitly4laravel/ServiceProviders/Laravel4ServiceProvider.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php namespace Jelovac\Bitly4laravel\ServiceProviders; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
class Laravel4ServiceProvider extends ServiceProvider { | ||
|
||
/** | ||
* Bootstrap the application events. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
$this->package('jelovac/bitly4laravel'); | ||
} | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->app['bitly4laravel'] = $this->app->share(function($app) { | ||
$config = $app['config']->get('bitly4laravel::config'); | ||
return new Bitly4laravel($config); | ||
}); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/Jelovac/Bitly4laravel/ServiceProviders/Laravel5ServiceProvider.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php namespace Jelovac\Bitly4laravel\ServiceProviders; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
class Laravel5ServiceProvider extends ServiceProvider { | ||
|
||
/** | ||
* Bootstrap the application events. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
$configPath = __DIR__ . '/../../config/bitly4laravel.php'; | ||
$paths = array( | ||
$configPath => $this->config_path("bitly4laravel.php"), | ||
); | ||
$this->publishes($paths, 'config'); | ||
} | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$configPath = __DIR__ . '/../../config/bitly4laravel.php'; | ||
$this->mergeConfigFrom($configPath, 'bitly4laravel'); | ||
$this->app['bitly4laravel'] = $this->app->share(function($app) { | ||
return new Bitly4laravel($app['config']); | ||
}); | ||
} | ||
|
||
} |