Skip to content

Commit 8f700e5

Browse files
committed
Update to Laravel 5
1 parent dcfc2be commit 8f700e5

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

composer.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@
1111
],
1212
"require": {
1313
"php": ">=5.3.0",
14-
"illuminate/support": "~4.0",
14+
"illuminate/support": "5.0.x",
1515
"omnipay/common": "~2.0"
1616
},
1717
"autoload": {
18-
"psr-0": {
19-
"Barryvdh\\Omnipay": "src/"
18+
"psr-4": {
19+
"Barryvdh\\Omnipay\\": "src/"
2020
}
2121
},
22-
"minimum-stability": "stable"
22+
"extra": {
23+
"branch-alias": {
24+
"dev-master": "0.2-dev"
25+
}
26+
},
27+
"minimum-stability": "dev"
2328
}
File renamed without changes.

readme.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
## Omnipay for Laravel 4
1+
## Omnipay for Laravel 5
2+
3+
### For Laravel 4, use the [0.1 version](https://github.com/barryvdh/laravel-omnipay/tree/v0.1.0).
24

35
This is a package to integrate [Omnipay](https://github.com/omnipay/omnipay) with Laravel.
46
You can use it to easily manage your configuration, and use the Facade to provide shortcuts to your gateway.
@@ -7,15 +9,15 @@ You can use it to easily manage your configuration, and use the Facade to provid
79

810
Require this package in your composer.json and run composer update (or run `composer require barryvdh/laravel-omnipay:0.1.x` directly):
911

10-
"barryvdh/laravel-omnipay": "0.1.*"
12+
"barryvdh/laravel-omnipay": "0.2.*@dev"
1113

12-
After updating composer, add the ServiceProvider to the providers array in app/config/app.php
14+
After updating composer, add the ServiceProvider to the providers array in config/app.php
1315

1416
'Barryvdh\Omnipay\ServiceProvider',
1517

1618
You need to publish the config for this package. A sample configuration is provided. The defaults will be merged with gateway specific configuration.
1719

18-
$ php artisan config:publish barryvdh/laravel-omnipay
20+
$ php artisan vendor:publish
1921

2022
To use the Facade (`Omnipay::purchase()` instead of `App::make(`omnipay`)->purchase()`), add that to the facades array.
2123

File renamed without changes.

src/Barryvdh/Omnipay/GatewayManager.php renamed to src/GatewayManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected function getConfig($name)
6161
{
6262
return array_merge(
6363
$this->defaults,
64-
$this->app['config']->get('laravel-omnipay::gateways.'.$name, array())
64+
$this->app['config']->get('omnipay.gateways.'.$name, array())
6565
);
6666
}
6767

@@ -72,7 +72,7 @@ protected function getConfig($name)
7272
*/
7373
public function getDefaultGateway()
7474
{
75-
return $this->app['config']['laravel-omnipay::gateway'];
75+
return $this->app['config']['omnipay.gateway'];
7676
}
7777

7878
/**
@@ -83,7 +83,7 @@ public function getDefaultGateway()
8383
*/
8484
public function setDefaultGateway($name)
8585
{
86-
$this->app['config']['laravel-omnipay::gateway'] = $name;
86+
$this->app['config']['omnipay.gateway'] = $name;
8787
}
8888

8989
/**

src/Barryvdh/Omnipay/ServiceProvider.php renamed to src/ServiceProvider.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,18 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider {
1111
*/
1212
protected $defer = false;
1313

14-
/**
15-
* Bootstrap the application events.
16-
*
17-
* @return void
18-
*/
19-
public function boot()
20-
{
21-
$this->app['config']->package('barryvdh/laravel-omnipay', $this->guessPackagePath() . '/config');
22-
}
23-
2414
/**
2515
* Register the service provider.
2616
*
2717
* @return void
2818
*/
2919
public function register()
3020
{
21+
$configPath = __DIR__ . '/../config/omnipay.php';
22+
$this->publishes([$configPath => config_path('omnipay.php')]);
23+
3124
$this->app['omnipay'] = $this->app->share(function ($app){
32-
$defaults = $app['config']->get('laravel-omnipay::defaults', array());
25+
$defaults = $app['config']->get('omnipay.defaults', array());
3326
return new GatewayManager($app, new GatewayFactory, $defaults);
3427
});
3528
}

0 commit comments

Comments
 (0)