@@ -9,47 +9,47 @@ |
||
9 | 9 | */ |
10 | 10 | class CustomersRepository |
11 | 11 | { |
12 | - /** |
|
13 | - * Customer Model instance. |
|
14 | - * |
|
15 | - * @var mixed |
|
16 | - **/ |
|
17 | - public $customer; |
|
18 | - |
|
19 | - /** |
|
20 | - * Create a new instance of the CustomerRepository::class. |
|
21 | - **/ |
|
22 | - public function __construct(Customer $customer) |
|
23 | - { |
|
24 | - $this->customer = $customer; |
|
25 | - } |
|
12 | + /** |
|
13 | + * Customer Model instance. |
|
14 | + * |
|
15 | + * @var mixed |
|
16 | + **/ |
|
17 | + public $customer; |
|
18 | + |
|
19 | + /** |
|
20 | + * Create a new instance of the CustomerRepository::class. |
|
21 | + **/ |
|
22 | + public function __construct(Customer $customer) |
|
23 | + { |
|
24 | + $this->customer = $customer; |
|
25 | + } |
|
26 | 26 | |
27 | 27 | //end __construct() |
28 | 28 | |
29 | - /** |
|
30 | - * Find a customer by a field. |
|
31 | - * |
|
32 | - * @return mixid $this |
|
33 | - **/ |
|
34 | - public function findCustomer($key, $value) |
|
35 | - { |
|
36 | - return $this->customer->where($key, $value)->first(); |
|
37 | - } |
|
29 | + /** |
|
30 | + * Find a customer by a field. |
|
31 | + * |
|
32 | + * @return mixid $this |
|
33 | + **/ |
|
34 | + public function findCustomer($key, $value) |
|
35 | + { |
|
36 | + return $this->customer->where($key, $value)->first(); |
|
37 | + } |
|
38 | 38 | |
39 | 39 | //end findCustomer() |
40 | 40 | |
41 | - /** |
|
42 | - * Create Customer with the received response. |
|
43 | - * |
|
44 | - * @return Customer |
|
45 | - * |
|
46 | - * @param array $data |
|
47 | - **/ |
|
48 | - public function createCustomer($data) |
|
49 | - { |
|
50 | - // TODO: Perform basic validation on the customer object before saving |
|
51 | - return $this->customer->create($data); |
|
52 | - } |
|
41 | + /** |
|
42 | + * Create Customer with the received response. |
|
43 | + * |
|
44 | + * @return Customer |
|
45 | + * |
|
46 | + * @param array $data |
|
47 | + **/ |
|
48 | + public function createCustomer($data) |
|
49 | + { |
|
50 | + // TODO: Perform basic validation on the customer object before saving |
|
51 | + return $this->customer->create($data); |
|
52 | + } |
|
53 | 53 | |
54 | 54 | //end createCustomer() |
55 | 55 | }//end class |
@@ -4,68 +4,68 @@ |
||
4 | 4 | |
5 | 5 | trait VerifiesPurchase |
6 | 6 | { |
7 | - /** |
|
8 | - * Customer Entity. |
|
9 | - * |
|
10 | - * @var mixed |
|
11 | - **/ |
|
12 | - protected $customer; |
|
7 | + /** |
|
8 | + * Customer Entity. |
|
9 | + * |
|
10 | + * @var mixed |
|
11 | + **/ |
|
12 | + protected $customer; |
|
13 | 13 | |
14 | - /** |
|
15 | - * Verify validity of the purchase key and if valid create customer. |
|
16 | - **/ |
|
17 | - public function verifyPurchase() |
|
18 | - { |
|
19 | - $this->getCustomer(); |
|
20 | - if (null != $this->customer) { |
|
21 | - return $this->validKeyResponse(); |
|
22 | - } |
|
14 | + /** |
|
15 | + * Verify validity of the purchase key and if valid create customer. |
|
16 | + **/ |
|
17 | + public function verifyPurchase() |
|
18 | + { |
|
19 | + $this->getCustomer(); |
|
20 | + if (null != $this->customer) { |
|
21 | + return $this->validKeyResponse(); |
|
22 | + } |
|
23 | 23 | |
24 | - $response = app()->envatoapi->verifyPurchase(request('code')); |
|
25 | - if ('error' == $response['status']) { |
|
26 | - return $this->invalidKeyResponse(); |
|
27 | - } |
|
24 | + $response = app()->envatoapi->verifyPurchase(request('code')); |
|
25 | + if ('error' == $response['status']) { |
|
26 | + return $this->invalidKeyResponse(); |
|
27 | + } |
|
28 | 28 | |
29 | - // If we are here then the key is valid |
|
30 | - // We now create a new customer record from the envato api response |
|
31 | - $this->customer = $this->customers->createCustomer($response['response']); |
|
32 | - // After creation of customer details return the response back to the user |
|
33 | - return $this->validKeyResponse(); |
|
34 | - } |
|
29 | + // If we are here then the key is valid |
|
30 | + // We now create a new customer record from the envato api response |
|
31 | + $this->customer = $this->customers->createCustomer($response['response']); |
|
32 | + // After creation of customer details return the response back to the user |
|
33 | + return $this->validKeyResponse(); |
|
34 | + } |
|
35 | 35 | |
36 | 36 | //end verifyPurchase() |
37 | 37 | |
38 | - /** |
|
39 | - * Return invalid key response. |
|
40 | - * |
|
41 | - * @return Illuminate\Http\Response |
|
42 | - **/ |
|
43 | - protected function invalidKeyResponse() |
|
44 | - { |
|
45 | - return response()->json(['status' => 'error', 'description' => 'Invalid purchase key'], 403); |
|
46 | - } |
|
38 | + /** |
|
39 | + * Return invalid key response. |
|
40 | + * |
|
41 | + * @return Illuminate\Http\Response |
|
42 | + **/ |
|
43 | + protected function invalidKeyResponse() |
|
44 | + { |
|
45 | + return response()->json(['status' => 'error', 'description' => 'Invalid purchase key'], 403); |
|
46 | + } |
|
47 | 47 | |
48 | 48 | //end invalidKeyResponse() |
49 | 49 | |
50 | - /** |
|
51 | - * Set the customer object. |
|
52 | - **/ |
|
53 | - protected function getCustomer() |
|
54 | - { |
|
55 | - $this->customer = $this->customers->findCustomer('purchaseKey', request()->get('code')); |
|
56 | - } |
|
50 | + /** |
|
51 | + * Set the customer object. |
|
52 | + **/ |
|
53 | + protected function getCustomer() |
|
54 | + { |
|
55 | + $this->customer = $this->customers->findCustomer('purchaseKey', request()->get('code')); |
|
56 | + } |
|
57 | 57 | |
58 | 58 | //end getCustomer() |
59 | 59 | |
60 | - /** |
|
61 | - * Return a success response if the purchase key is valid. |
|
62 | - * |
|
63 | - * @return Illuminate\Http\Response json object response |
|
64 | - **/ |
|
65 | - protected function validKeyResponse() |
|
66 | - { |
|
67 | - return response()->json(['status' => 'success', 'description' => $this->customer->tojson()]); |
|
68 | - } |
|
60 | + /** |
|
61 | + * Return a success response if the purchase key is valid. |
|
62 | + * |
|
63 | + * @return Illuminate\Http\Response json object response |
|
64 | + **/ |
|
65 | + protected function validKeyResponse() |
|
66 | + { |
|
67 | + return response()->json(['status' => 'success', 'description' => $this->customer->tojson()]); |
|
68 | + } |
|
69 | 69 | |
70 | 70 | //end validKeyResponse() |
71 | 71 | } |
@@ -10,45 +10,45 @@ |
||
10 | 10 | */ |
11 | 11 | class UpdatesManager |
12 | 12 | { |
13 | - /** |
|
14 | - * Update Repository. |
|
15 | - * |
|
16 | - * @var mixed |
|
17 | - **/ |
|
18 | - public $repository; |
|
19 | - |
|
20 | - /** |
|
21 | - * Create a new instance of the UpdatesManager::class. |
|
22 | - * |
|
23 | - * @param RepositoryContract $repository description |
|
24 | - **/ |
|
25 | - public function __construct(RepositoryContract $repository) |
|
26 | - { |
|
27 | - $this->repository = $repository; |
|
28 | - } |
|
13 | + /** |
|
14 | + * Update Repository. |
|
15 | + * |
|
16 | + * @var mixed |
|
17 | + **/ |
|
18 | + public $repository; |
|
19 | + |
|
20 | + /** |
|
21 | + * Create a new instance of the UpdatesManager::class. |
|
22 | + * |
|
23 | + * @param RepositoryContract $repository description |
|
24 | + **/ |
|
25 | + public function __construct(RepositoryContract $repository) |
|
26 | + { |
|
27 | + $this->repository = $repository; |
|
28 | + } |
|
29 | 29 | |
30 | 30 | //end __construct() |
31 | 31 | |
32 | - /** |
|
33 | - * Determin if the customer has already verified the product. |
|
34 | - * |
|
35 | - * @param string $purchaseKey |
|
36 | - **/ |
|
37 | - public function verifyCustomer($purchaseKey) |
|
38 | - { |
|
39 | - $this->repository->findCustomer($purchaseKey); |
|
40 | - } |
|
32 | + /** |
|
33 | + * Determin if the customer has already verified the product. |
|
34 | + * |
|
35 | + * @param string $purchaseKey |
|
36 | + **/ |
|
37 | + public function verifyCustomer($purchaseKey) |
|
38 | + { |
|
39 | + $this->repository->findCustomer($purchaseKey); |
|
40 | + } |
|
41 | 41 | |
42 | 42 | //end verifyCustomer() |
43 | 43 | |
44 | - /** |
|
45 | - * Get a specific update version. |
|
46 | - * |
|
47 | - * @param string $version Build version |
|
48 | - **/ |
|
49 | - public function getRelease($version) |
|
50 | - { |
|
51 | - } |
|
44 | + /** |
|
45 | + * Get a specific update version. |
|
46 | + * |
|
47 | + * @param string $version Build version |
|
48 | + **/ |
|
49 | + public function getRelease($version) |
|
50 | + { |
|
51 | + } |
|
52 | 52 | |
53 | 53 | //end getRelease() |
54 | 54 | }//end class |
@@ -2,5 +2,5 @@ |
||
2 | 2 | /** |
3 | 3 | * Application update routes. |
4 | 4 | **/ |
5 | -Route::group(['prefix' => 'updates', 'namespace' => 'Elimuswift\\Core\\Controllers'], function () { |
|
5 | +Route::group(['prefix' => 'updates', 'namespace' => 'Elimuswift\\Core\\Controllers'], function() { |
|
6 | 6 | }); |
@@ -6,37 +6,37 @@ |
||
6 | 6 | |
7 | 7 | class CreateUpdatesTable extends Migration |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the migrations. |
|
11 | - */ |
|
12 | - public function up() |
|
13 | - { |
|
14 | - Schema::create('updates', function (Blueprint $table) { |
|
15 | - $table->increments('id'); |
|
16 | - $table->string('title'); |
|
17 | - $table->string('version', 10); |
|
18 | - $table->string('type'); |
|
19 | - $table->text('description'); |
|
20 | - $table->integer('downloads'); |
|
21 | - $table->timestamps(); |
|
22 | - }); |
|
9 | + /** |
|
10 | + * Run the migrations. |
|
11 | + */ |
|
12 | + public function up() |
|
13 | + { |
|
14 | + Schema::create('updates', function (Blueprint $table) { |
|
15 | + $table->increments('id'); |
|
16 | + $table->string('title'); |
|
17 | + $table->string('version', 10); |
|
18 | + $table->string('type'); |
|
19 | + $table->text('description'); |
|
20 | + $table->integer('downloads'); |
|
21 | + $table->timestamps(); |
|
22 | + }); |
|
23 | 23 | |
24 | - Schema::create('customers', function (Blueprint $table) { |
|
25 | - $table->increments('id'); |
|
26 | - $table->string('name'); |
|
27 | - $table->string('purchaseKey'); |
|
28 | - $table->timestamp('support_ends'); |
|
29 | - $table->string('email')->unique(); |
|
30 | - $table->timestamps(); |
|
31 | - }); |
|
32 | - } |
|
24 | + Schema::create('customers', function (Blueprint $table) { |
|
25 | + $table->increments('id'); |
|
26 | + $table->string('name'); |
|
27 | + $table->string('purchaseKey'); |
|
28 | + $table->timestamp('support_ends'); |
|
29 | + $table->string('email')->unique(); |
|
30 | + $table->timestamps(); |
|
31 | + }); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Reverse the migrations. |
|
36 | - */ |
|
37 | - public function down() |
|
38 | - { |
|
39 | - Schema::dropIfExists('customers'); |
|
40 | - Schema::dropIfExists('updates'); |
|
41 | - } |
|
34 | + /** |
|
35 | + * Reverse the migrations. |
|
36 | + */ |
|
37 | + public function down() |
|
38 | + { |
|
39 | + Schema::dropIfExists('customers'); |
|
40 | + Schema::dropIfExists('updates'); |
|
41 | + } |
|
42 | 42 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public function up() |
13 | 13 | { |
14 | - Schema::create('updates', function (Blueprint $table) { |
|
14 | + Schema::create('updates', function(Blueprint $table) { |
|
15 | 15 | $table->increments('id'); |
16 | 16 | $table->string('title'); |
17 | 17 | $table->string('version', 10); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $table->timestamps(); |
22 | 22 | }); |
23 | 23 | |
24 | - Schema::create('customers', function (Blueprint $table) { |
|
24 | + Schema::create('customers', function(Blueprint $table) { |
|
25 | 25 | $table->increments('id'); |
26 | 26 | $table->string('name'); |
27 | 27 | $table->string('purchaseKey'); |
@@ -6,51 +6,51 @@ |
||
6 | 6 | |
7 | 7 | class ElimuswiftCoreServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | - /** |
|
10 | - * Bootstrap the application services. |
|
11 | - */ |
|
12 | - public function boot() |
|
13 | - { |
|
14 | - $this->loadFiles(); |
|
15 | - } |
|
9 | + /** |
|
10 | + * Bootstrap the application services. |
|
11 | + */ |
|
12 | + public function boot() |
|
13 | + { |
|
14 | + $this->loadFiles(); |
|
15 | + } |
|
16 | 16 | |
17 | 17 | //end boot() |
18 | 18 | |
19 | - /** |
|
20 | - * Register the application services. |
|
21 | - */ |
|
22 | - public function register() |
|
23 | - { |
|
24 | - $this->mergeConfigFrom( |
|
25 | - __DIR__ . '/config/core.php', |
|
26 | - 'core' |
|
27 | - ); |
|
28 | - |
|
29 | - $this->app->singleton( |
|
30 | - 'envatoapi', |
|
31 | - function () { |
|
32 | - return new EnvatoApi(env('ENVATO_SECRET')); |
|
33 | - } |
|
34 | - ); |
|
35 | - |
|
36 | - $this->app->bind('Elimuswift\Core\Repositories\Contracts\RepositoryContract', 'Elimuswift\Core\Repositories\UpdatesRepository'); |
|
37 | - } |
|
19 | + /** |
|
20 | + * Register the application services. |
|
21 | + */ |
|
22 | + public function register() |
|
23 | + { |
|
24 | + $this->mergeConfigFrom( |
|
25 | + __DIR__ . '/config/core.php', |
|
26 | + 'core' |
|
27 | + ); |
|
28 | + |
|
29 | + $this->app->singleton( |
|
30 | + 'envatoapi', |
|
31 | + function () { |
|
32 | + return new EnvatoApi(env('ENVATO_SECRET')); |
|
33 | + } |
|
34 | + ); |
|
35 | + |
|
36 | + $this->app->bind('Elimuswift\Core\Repositories\Contracts\RepositoryContract', 'Elimuswift\Core\Repositories\UpdatesRepository'); |
|
37 | + } |
|
38 | 38 | |
39 | 39 | //end register() |
40 | 40 | |
41 | - /** |
|
42 | - * Load and publish app migration files. |
|
43 | - **/ |
|
44 | - protected function loadFiles() |
|
45 | - { |
|
46 | - $this->publishes( |
|
47 | - [ |
|
48 | - __DIR__ . 'config/core.php' => config_path('core.php'), |
|
49 | - ] |
|
50 | - ); |
|
51 | - // $this->loadMigrationsFrom(__DIR__.'/Migrations'); |
|
52 | - $this->loadRoutesFrom(__DIR__ . '/routes.php'); |
|
53 | - } |
|
41 | + /** |
|
42 | + * Load and publish app migration files. |
|
43 | + **/ |
|
44 | + protected function loadFiles() |
|
45 | + { |
|
46 | + $this->publishes( |
|
47 | + [ |
|
48 | + __DIR__ . 'config/core.php' => config_path('core.php'), |
|
49 | + ] |
|
50 | + ); |
|
51 | + // $this->loadMigrationsFrom(__DIR__.'/Migrations'); |
|
52 | + $this->loadRoutesFrom(__DIR__ . '/routes.php'); |
|
53 | + } |
|
54 | 54 | |
55 | 55 | //end loadFiles() |
56 | 56 | }//end class |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | public function register() |
23 | 23 | { |
24 | 24 | $this->mergeConfigFrom( |
25 | - __DIR__ . '/config/core.php', |
|
25 | + __DIR__.'/config/core.php', |
|
26 | 26 | 'core' |
27 | 27 | ); |
28 | 28 | |
29 | 29 | $this->app->singleton( |
30 | 30 | 'envatoapi', |
31 | - function () { |
|
31 | + function() { |
|
32 | 32 | return new EnvatoApi(env('ENVATO_SECRET')); |
33 | 33 | } |
34 | 34 | ); |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | { |
46 | 46 | $this->publishes( |
47 | 47 | [ |
48 | - __DIR__ . 'config/core.php' => config_path('core.php'), |
|
48 | + __DIR__.'config/core.php' => config_path('core.php'), |
|
49 | 49 | ] |
50 | 50 | ); |
51 | 51 | // $this->loadMigrationsFrom(__DIR__.'/Migrations'); |
52 | - $this->loadRoutesFrom(__DIR__ . '/routes.php'); |
|
52 | + $this->loadRoutesFrom(__DIR__.'/routes.php'); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | //end loadFiles() |
@@ -7,15 +7,15 @@ |
||
7 | 7 | */ |
8 | 8 | class FilesystemRepository |
9 | 9 | { |
10 | - /** |
|
11 | - * Get a specific update version. |
|
12 | - * |
|
13 | - * @return object Illuminate\Filesystem\Filesystem instance |
|
14 | - * |
|
15 | - * @param string $version Build version |
|
16 | - **/ |
|
17 | - public function getRelease($version) |
|
18 | - { |
|
19 | - return \Storage::get("updates/update_{$version}.zip"); |
|
20 | - } |
|
10 | + /** |
|
11 | + * Get a specific update version. |
|
12 | + * |
|
13 | + * @return object Illuminate\Filesystem\Filesystem instance |
|
14 | + * |
|
15 | + * @param string $version Build version |
|
16 | + **/ |
|
17 | + public function getRelease($version) |
|
18 | + { |
|
19 | + return \Storage::get("updates/update_{$version}.zip"); |
|
20 | + } |
|
21 | 21 | } |
@@ -7,37 +7,37 @@ |
||
7 | 7 | */ |
8 | 8 | interface RepositoryContract |
9 | 9 | { |
10 | - /** |
|
11 | - * Return all the available releses. |
|
12 | - * |
|
13 | - * @return mixed Illuminate\Support\Collection |
|
14 | - **/ |
|
15 | - public function releases(); |
|
10 | + /** |
|
11 | + * Return all the available releses. |
|
12 | + * |
|
13 | + * @return mixed Illuminate\Support\Collection |
|
14 | + **/ |
|
15 | + public function releases(); |
|
16 | 16 | |
17 | - /** |
|
18 | - * Get a specific update version. |
|
19 | - * |
|
20 | - * @return object Elimuswift\Core\Update instance |
|
21 | - * @return object Illuminate\Filesystem\Filesystem |
|
22 | - * |
|
23 | - * @param string $version Build version |
|
24 | - **/ |
|
25 | - public function getRelease($version); |
|
17 | + /** |
|
18 | + * Get a specific update version. |
|
19 | + * |
|
20 | + * @return object Elimuswift\Core\Update instance |
|
21 | + * @return object Illuminate\Filesystem\Filesystem |
|
22 | + * |
|
23 | + * @param string $version Build version |
|
24 | + **/ |
|
25 | + public function getRelease($version); |
|
26 | 26 | |
27 | - /** |
|
28 | - * Get releases later than the provided $version. |
|
29 | - * |
|
30 | - * @return object Illuminate\Support\Collection |
|
31 | - * |
|
32 | - * @param string $version Version to compare |
|
33 | - **/ |
|
34 | - public function laterThan($version); |
|
27 | + /** |
|
28 | + * Get releases later than the provided $version. |
|
29 | + * |
|
30 | + * @return object Illuminate\Support\Collection |
|
31 | + * |
|
32 | + * @param string $version Version to compare |
|
33 | + **/ |
|
34 | + public function laterThan($version); |
|
35 | 35 | |
36 | - /** |
|
37 | - * Get the latest update version. |
|
38 | - * |
|
39 | - * @return object Elimuswift\Core\Update instance |
|
40 | - * @return object Illuminate\Filesystem\Filesystem |
|
41 | - **/ |
|
42 | - public function latest(); |
|
36 | + /** |
|
37 | + * Get the latest update version. |
|
38 | + * |
|
39 | + * @return object Elimuswift\Core\Update instance |
|
40 | + * @return object Illuminate\Filesystem\Filesystem |
|
41 | + **/ |
|
42 | + public function latest(); |
|
43 | 43 | } |
@@ -9,75 +9,75 @@ |
||
9 | 9 | */ |
10 | 10 | class UpdatesRepository implements Contracts\RepositoryContract |
11 | 11 | { |
12 | - /** |
|
13 | - * Update Model instance. |
|
14 | - * |
|
15 | - * @var mixed |
|
16 | - **/ |
|
17 | - public $updates; |
|
12 | + /** |
|
13 | + * Update Model instance. |
|
14 | + * |
|
15 | + * @var mixed |
|
16 | + **/ |
|
17 | + public $updates; |
|
18 | 18 | |
19 | - /** |
|
20 | - * Create a new instance of the UpdatesManager::class. |
|
21 | - **/ |
|
22 | - public function __construct(Update $update) |
|
23 | - { |
|
24 | - $this->updates = $update; |
|
25 | - } |
|
19 | + /** |
|
20 | + * Create a new instance of the UpdatesManager::class. |
|
21 | + **/ |
|
22 | + public function __construct(Update $update) |
|
23 | + { |
|
24 | + $this->updates = $update; |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * Return all the available releses. |
|
29 | - * |
|
30 | - * @return mixed Illuminate\Support\Collection |
|
31 | - **/ |
|
32 | - public function releases() |
|
33 | - { |
|
34 | - return $this->updates->all(); |
|
35 | - } |
|
27 | + /** |
|
28 | + * Return all the available releses. |
|
29 | + * |
|
30 | + * @return mixed Illuminate\Support\Collection |
|
31 | + **/ |
|
32 | + public function releases() |
|
33 | + { |
|
34 | + return $this->updates->all(); |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * Get a specific update version. |
|
39 | - * |
|
40 | - * @return object Elimuswift\Core\Update instance |
|
41 | - * |
|
42 | - * @param string $version Build version |
|
43 | - **/ |
|
44 | - public function getRelease($version) |
|
45 | - { |
|
46 | - return $this->updates->whereVersion($version)->first(); |
|
47 | - } |
|
37 | + /** |
|
38 | + * Get a specific update version. |
|
39 | + * |
|
40 | + * @return object Elimuswift\Core\Update instance |
|
41 | + * |
|
42 | + * @param string $version Build version |
|
43 | + **/ |
|
44 | + public function getRelease($version) |
|
45 | + { |
|
46 | + return $this->updates->whereVersion($version)->first(); |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * Get releases later than the provided $version. |
|
51 | - * |
|
52 | - * @return object Illuminate\Support\Collection |
|
53 | - * |
|
54 | - * @param string $version Version to compare |
|
55 | - **/ |
|
56 | - public function laterThan($version) |
|
57 | - { |
|
58 | - return $this->updates->where('version', '>', $version)->get(); |
|
59 | - } |
|
49 | + /** |
|
50 | + * Get releases later than the provided $version. |
|
51 | + * |
|
52 | + * @return object Illuminate\Support\Collection |
|
53 | + * |
|
54 | + * @param string $version Version to compare |
|
55 | + **/ |
|
56 | + public function laterThan($version) |
|
57 | + { |
|
58 | + return $this->updates->where('version', '>', $version)->get(); |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * Get the latest update version. |
|
63 | - * |
|
64 | - * @return object Elimuswift\Core\Update instance |
|
65 | - **/ |
|
66 | - public function latest() |
|
67 | - { |
|
68 | - return $this->updates->orderBy('version', 'DESC')->first(); |
|
69 | - } |
|
61 | + /** |
|
62 | + * Get the latest update version. |
|
63 | + * |
|
64 | + * @return object Elimuswift\Core\Update instance |
|
65 | + **/ |
|
66 | + public function latest() |
|
67 | + { |
|
68 | + return $this->updates->orderBy('version', 'DESC')->first(); |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * Get config properties. |
|
73 | - * |
|
74 | - * @return mixed |
|
75 | - **/ |
|
76 | - public function config($property) |
|
77 | - { |
|
78 | - if (config()->has("core.{$property}")) { |
|
79 | - return config()->get("core.{$property}"); |
|
80 | - } |
|
81 | - throw new \Exception("Property {$property} does not exist", 1); |
|
82 | - } |
|
71 | + /** |
|
72 | + * Get config properties. |
|
73 | + * |
|
74 | + * @return mixed |
|
75 | + **/ |
|
76 | + public function config($property) |
|
77 | + { |
|
78 | + if (config()->has("core.{$property}")) { |
|
79 | + return config()->get("core.{$property}"); |
|
80 | + } |
|
81 | + throw new \Exception("Property {$property} does not exist", 1); |
|
82 | + } |
|
83 | 83 | } |