@@ -75,7 +75,7 @@ |
||
75 | 75 | **/ |
76 | 76 | public function config($property) |
77 | 77 | { |
78 | - if(config()->has("core.{$property}")){ |
|
78 | + if (config()->has("core.{$property}")) { |
|
79 | 79 | return config()->get("core.{$property}"); |
80 | 80 | } |
81 | 81 | throw new \Exception("Property {$property} does not exist", 1); |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | public function verifyPurchase() |
21 | 21 | { |
22 | 22 | $this->getCustomer(); |
23 | - if(null != $this->customer) |
|
23 | + if (null != $this->customer) |
|
24 | 24 | return $this->validKeyResponse(); |
25 | 25 | |
26 | 26 | $response = app()->envatoapi->verifyPurchase(request('code')); |
27 | - if('error' == $response['status']) |
|
27 | + if ('error' == $response['status']) |
|
28 | 28 | return $this->invalidKeyResponse(); |
29 | 29 | // If we are here then the key is valid |
30 | 30 | // We now create a new customer record from the envato api response |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | **/ |
51 | 51 | protected function getCustomer() |
52 | 52 | { |
53 | - $this->customer = $this->customers->findCustomer('purchaseKey',request()->get('code')); |
|
53 | + $this->customer = $this->customers->findCustomer('purchaseKey', request()->get('code')); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -20,12 +20,14 @@ |
||
20 | 20 | public function verifyPurchase() |
21 | 21 | { |
22 | 22 | $this->getCustomer(); |
23 | - if(null != $this->customer) |
|
24 | - return $this->validKeyResponse(); |
|
23 | + if(null != $this->customer) { |
|
24 | + return $this->validKeyResponse(); |
|
25 | + } |
|
25 | 26 | |
26 | 27 | $response = app()->envatoapi->verifyPurchase(request('code')); |
27 | - if('error' == $response['status']) |
|
28 | - return $this->invalidKeyResponse(); |
|
28 | + if('error' == $response['status']) { |
|
29 | + return $this->invalidKeyResponse(); |
|
30 | + } |
|
29 | 31 | // If we are here then the key is valid |
30 | 32 | // We now create a new customer record from the envato api response |
31 | 33 | $this->customer = $this->customers->createCustomer($response['response']); |
@@ -6,48 +6,48 @@ |
||
6 | 6 | class ElimuswiftCoreServiceProvider extends ServiceProvider |
7 | 7 | { |
8 | 8 | |
9 | - /** |
|
10 | - * Bootstrap the application services. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function boot() |
|
15 | - { |
|
16 | - $this->loadFiles(); |
|
17 | - } |
|
18 | - |
|
19 | - |
|
20 | - /** |
|
21 | - * Register the application services. |
|
22 | - * |
|
23 | - * @return void |
|
24 | - */ |
|
25 | - public function register() |
|
26 | - { |
|
27 | - $this->mergeConfigFrom( |
|
28 | - __DIR__.'/config/core.php', 'core' |
|
29 | - ); |
|
30 | - |
|
31 | - $this->app->singleton('envatoapi', function(){ |
|
32 | - return new EnvatoApi(env('ENVATO_SECRET')); |
|
33 | - }); |
|
34 | - |
|
35 | - $this->app->bind('Elimuswift\Core\Repositories\Contracts\RepositoryContract', 'Elimuswift\Core\Repositories\UpdatesRepository'); |
|
36 | - } |
|
37 | - |
|
38 | - /** |
|
39 | - * Load and publish app migration files |
|
40 | - * |
|
41 | - * @return void |
|
42 | - * |
|
43 | - **/ |
|
44 | - protected function loadFiles() |
|
45 | - { |
|
46 | - $this->publishes([ |
|
47 | - __DIR__.'config/core.php' => config_path('core.php'), |
|
48 | - ]); |
|
49 | - $this->loadMigrationsFrom(__DIR__.'/Migrations'); |
|
50 | - $this->loadRoutesFrom(__DIR__.'/routes.php'); |
|
51 | - } |
|
9 | + /** |
|
10 | + * Bootstrap the application services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadFiles(); |
|
17 | + } |
|
18 | + |
|
19 | + |
|
20 | + /** |
|
21 | + * Register the application services. |
|
22 | + * |
|
23 | + * @return void |
|
24 | + */ |
|
25 | + public function register() |
|
26 | + { |
|
27 | + $this->mergeConfigFrom( |
|
28 | + __DIR__.'/config/core.php', 'core' |
|
29 | + ); |
|
30 | + |
|
31 | + $this->app->singleton('envatoapi', function(){ |
|
32 | + return new EnvatoApi(env('ENVATO_SECRET')); |
|
33 | + }); |
|
34 | + |
|
35 | + $this->app->bind('Elimuswift\Core\Repositories\Contracts\RepositoryContract', 'Elimuswift\Core\Repositories\UpdatesRepository'); |
|
36 | + } |
|
37 | + |
|
38 | + /** |
|
39 | + * Load and publish app migration files |
|
40 | + * |
|
41 | + * @return void |
|
42 | + * |
|
43 | + **/ |
|
44 | + protected function loadFiles() |
|
45 | + { |
|
46 | + $this->publishes([ |
|
47 | + __DIR__.'config/core.php' => config_path('core.php'), |
|
48 | + ]); |
|
49 | + $this->loadMigrationsFrom(__DIR__.'/Migrations'); |
|
50 | + $this->loadRoutesFrom(__DIR__.'/routes.php'); |
|
51 | + } |
|
52 | 52 | |
53 | 53 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | __DIR__.'/config/core.php', 'core' |
29 | 29 | ); |
30 | 30 | |
31 | - $this->app->singleton('envatoapi', function(){ |
|
31 | + $this->app->singleton('envatoapi', function() { |
|
32 | 32 | return new EnvatoApi(env('ENVATO_SECRET')); |
33 | 33 | }); |
34 | 34 |
@@ -12,9 +12,9 @@ |
||
12 | 12 | class InstallManagerController extends Controller |
13 | 13 | { |
14 | 14 | /** |
15 | - * When including this trait make sure you inject RepositoryContract as $repository |
|
16 | - * and CustomersRepository as $customers to the constructor |
|
17 | - */ |
|
15 | + * When including this trait make sure you inject RepositoryContract as $repository |
|
16 | + * and CustomersRepository as $customers to the constructor |
|
17 | + */ |
|
18 | 18 | use VerifiesPurchase; |
19 | 19 | |
20 | 20 | /** |
@@ -51,10 +51,10 @@ |
||
51 | 51 | public function getInstaller($version) |
52 | 52 | { |
53 | 53 | $response = $this->verifyPurchase(); |
54 | - if(null == $this->customer) |
|
54 | + if (null == $this->customer) |
|
55 | 55 | return $this->invalidKeyResponse(); |
56 | 56 | $install = $this->repository->config('install.resourcePath')."/install_{$version}.zip"; |
57 | - if(file_exists($install)){ |
|
57 | + if (file_exists($install)) { |
|
58 | 58 | return response()->download($install); |
59 | 59 | } |
60 | 60 |
@@ -51,8 +51,9 @@ |
||
51 | 51 | public function getInstaller($version) |
52 | 52 | { |
53 | 53 | $response = $this->verifyPurchase(); |
54 | - if(null == $this->customer) |
|
55 | - return $this->invalidKeyResponse(); |
|
54 | + if(null == $this->customer) { |
|
55 | + return $this->invalidKeyResponse(); |
|
56 | + } |
|
56 | 57 | $install = $this->repository->config('install.resourcePath')."/install_{$version}.zip"; |
57 | 58 | if(file_exists($install)){ |
58 | 59 | return response()->download($install); |
@@ -48,10 +48,10 @@ |
||
48 | 48 | public function fetchUpdate($version) |
49 | 49 | { |
50 | 50 | $this->getCustomer(); |
51 | - if(null == $this->customer) |
|
51 | + if (null == $this->customer) |
|
52 | 52 | return $this->invalidKeyResponse(); |
53 | 53 | $update = $this->repository->config('updates.updatesPath')."/update_{$version}.zip"; |
54 | - if(file_exists($update)){ |
|
54 | + if (file_exists($update)) { |
|
55 | 55 | return response()->download($update); |
56 | 56 | } |
57 | 57 |
@@ -48,8 +48,9 @@ |
||
48 | 48 | public function fetchUpdate($version) |
49 | 49 | { |
50 | 50 | $this->getCustomer(); |
51 | - if(null == $this->customer) |
|
52 | - return $this->invalidKeyResponse(); |
|
51 | + if(null == $this->customer) { |
|
52 | + return $this->invalidKeyResponse(); |
|
53 | + } |
|
53 | 54 | $update = $this->repository->config('updates.updatesPath')."/update_{$version}.zip"; |
54 | 55 | if(file_exists($update)){ |
55 | 56 | return response()->download($update); |