@@ -16,11 +16,11 @@ |
||
16 | 16 | */ |
17 | 17 | public function handle($request, Closure $next) |
18 | 18 | { |
19 | - if(AppLicense::check()){ |
|
19 | + if (AppLicense::check()) { |
|
20 | 20 | return $next($request); |
21 | 21 | } |
22 | 22 | $license = AppLicense::get(); |
23 | - return abort(503,$license->message); |
|
23 | + return abort(503, $license->message); |
|
24 | 24 | |
25 | 25 | } |
26 | 26 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | public function boot() |
25 | 25 | { |
26 | 26 | $this->publishes([ |
27 | - __DIR__.'/../config/irfa/' => config_path('irfa')],'app-license-client'); |
|
27 | + __DIR__.'/../config/irfa/' => config_path('irfa')], 'app-license-client'); |
|
28 | 28 | |
29 | 29 | |
30 | 30 | } |
@@ -9,17 +9,17 @@ |
||
9 | 9 | |
10 | 10 | class SerialConnector |
11 | 11 | { |
12 | - protected $res_active; |
|
13 | - protected $res_message; |
|
12 | + protected $res_active; |
|
13 | + protected $res_message; |
|
14 | 14 | |
15 | - protected function checkSN() |
|
16 | - { |
|
17 | - $json = json_decode(Curl::to(config('irfa.app_license_client.url')) |
|
18 | - ->withData(array('serial' => config('irfa.app_license_client.serial_number'))) |
|
19 | - ->post()); |
|
20 | - $this->res_active = $json->data->active; |
|
21 | - $this->res_message = $json->data->message; |
|
15 | + protected function checkSN() |
|
16 | + { |
|
17 | + $json = json_decode(Curl::to(config('irfa.app_license_client.url')) |
|
18 | + ->withData(array('serial' => config('irfa.app_license_client.serial_number'))) |
|
19 | + ->post()); |
|
20 | + $this->res_active = $json->data->active; |
|
21 | + $this->res_message = $json->data->message; |
|
22 | 22 | |
23 | - return $this->res_active; |
|
24 | - } |
|
23 | + return $this->res_active; |
|
24 | + } |
|
25 | 25 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | public function get() |
20 | 20 | { |
21 | - return (object)['active' => $this->res_active,'message' => $this->res_message]; |
|
21 | + return (object)['active' => $this->res_active, 'message' => $this->res_message]; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | } |
@@ -10,4 +10,4 @@ |
||
10 | 10 | | contains the "web" middleware group. Now create something great! |
11 | 11 | | |
12 | 12 | */ |
13 | -Route::get('/check','Controller\AppLicenseController@check'); |
|
14 | 13 | \ No newline at end of file |
14 | +Route::get('/check', 'Controller\AppLicenseController@check'); |
|
15 | 15 | \ No newline at end of file |
@@ -13,4 +13,4 @@ |
||
13 | 13 | | |
14 | 14 | */ |
15 | 15 | |
16 | -Route::get('/check','Controller\AppLicenseController@check'); |
|
16 | +Route::get('/check', 'Controller\AppLicenseController@check'); |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | - return [ |
|
2 | + return [ |
|
3 | 3 | |
4 | - 'serial_number' => env('SERIAL_NUMBER',null), |
|
5 | - 'url' => env('LICENSE',null), |
|
4 | + 'serial_number' => env('SERIAL_NUMBER',null), |
|
5 | + 'url' => env('LICENSE',null), |
|
6 | 6 | |
7 | 7 | ]; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | |
4 | - 'serial_number' => env('SERIAL_NUMBER',null), |
|
5 | - 'url' => env('LICENSE',null), |
|
4 | + 'serial_number' => env('SERIAL_NUMBER', null), |
|
5 | + 'url' => env('LICENSE', null), |
|
6 | 6 | |
7 | 7 | ]; |
@@ -13,14 +13,14 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('license_serials', function (Blueprint $table) { |
|
16 | + Schema::create('license_serials', function(Blueprint $table) { |
|
17 | 17 | $table->bigIncrements('id'); |
18 | - $table->string('name',65); |
|
19 | - $table->string('domain',120); |
|
20 | - $table->string('phone_number',30)->nullable(); |
|
18 | + $table->string('name', 65); |
|
19 | + $table->string('domain', 120); |
|
20 | + $table->string('phone_number', 30)->nullable(); |
|
21 | 21 | $table->text('address')->nullable(); |
22 | - $table->string('serial',120)->unique(); |
|
23 | - $table->string('expired',16); |
|
22 | + $table->string('serial', 120)->unique(); |
|
23 | + $table->string('expired', 16); |
|
24 | 24 | $table->boolean('status')->default(0); |
25 | 25 | $table->timestamps(); |
26 | 26 | }); |