| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\License; |
| 4 |
|
| 5 |
use Give\Framework\Migrations\MigrationsRegister; |
| 6 |
use Give\Helpers\Hooks; |
| 7 |
use Give\License\Actions\AddPlatformFeeAmountToSystemInfo; |
| 8 |
use Give\License\Migrations\RefreshLicensesForPlatformFee; |
| 9 |
use Give\License\Migrations\RefreshLicensesForLastActiveDate; |
| 10 |
use Give\License\Repositories\LicenseRepository; |
| 11 |
use Give\ServiceProviders\ServiceProvider; |
| 12 |
|
| 13 |
class LicenseServiceProvider implements ServiceProvider |
| 14 |
{ |
| 15 |
/** |
| 16 |
* @since 4.3.0 added LicenseRepository singleton |
| 17 |
* @since 2.11.3 |
| 18 |
*/ |
| 19 |
public function register() |
| 20 |
{ |
| 21 |
give()->singleton(PremiumAddonsListManager::class); |
| 22 |
give()->singleton(LicenseRepository::class); |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* @since 4.3.0 added refresh-licenses-for-platform-fee migration |
| 27 |
* @since 2.11.3 |
| 28 |
*/ |
| 29 |
public function boot() |
| 30 |
{ |
| 31 |
/** @var MigrationsRegister $migrationRegistrar */ |
| 32 |
$migrationRegistrar = give(MigrationsRegister::class); |
| 33 |
|
| 34 |
$migrationRegistrar->addMigration(RefreshLicensesForPlatformFee::class); |
| 35 |
$migrationRegistrar->addMigration(RefreshLicensesForLastActiveDate::class); |
| 36 |
|
| 37 |
Hooks::addAction('give_add_system_info_configuration', AddPlatformFeeAmountToSystemInfo::class); |
| 38 |
} |
| 39 |
} |
| 40 |
|