LucasDotVin\Soulbscription\Enums\PeriodicityType::getDateDifference(): Argument #3 ($unit) must be of type string, null given, called in /home/schneider/Code/tonote/vendor/lucasdotvin/laravel-soulbscription/src/Models/Concerns/HandlesRecurrence.php on line 20
Schneidershades opened this issue ยท 7 comments
LucasDotVin\Soulbscription\Enums\PeriodicityType::getDateDifference(): Argument #3 ($unit) must be of type string, null given, called in /home/schneider/Code/tonote/vendor/lucasdotvin/laravel-soulbscription/src/Models/Concerns/HandlesRecurrence.php on line 20
Hey! Thanks for reporting this bug! Could you provide some details? I'm gonna work to publish a release today to fix it if possible. ๐ค
@lucasdotvin thank you when i try to implement the it returns the error
$subscriber->consume('Number of Users', 1);
it returns the error
Oh, so it is thrown when you try to consume a feature... Could you send me some screenshots of how your plans are configured? ๐
Was trying to record in my model observers that the user team has consumed one feature to add user based on attached plan_features
$basic = Plan::create([
'name' => 'Basic',
'role' => 'User',
'description' => 'Basic',
'type' => 'Subscription',
'amount' => 0,
'periodicity' => 1,
'periodicity_type' => PeriodicityType::Month,
]);
$pro = Plan::create([
'name' => 'Pro',
'role' => 'User',
'description' => 'Pro',
'type' => 'Subscription',
'amount' => 9900,
'periodicity' => 1,
'periodicity_type' => PeriodicityType::Month,
]);
$business = Plan::create([
'name' => 'Business',
'role' => 'User',
'description' => 'Business',
'type' => 'Subscription',
'amount' => 19900,
'periodicity' => 1,
'periodicity_type' => PeriodicityType::Month,
]);
$usersFeature = Feature::where('name', 'Number of Users')->first();
$envelopsFeature = Feature::where('name', 'Number of Envelops')->first();
$trailFeature = Feature::where('name', 'Access to audit trail')->first();
$sealFeature = Feature::where('name', 'Digitise, Signature, Stamp and Seal')->first();
$brandingFeature = Feature::where('name', 'Personal Branding')->first();
$smsFeature = Feature::where('name', 'SMS Notifications')->first();
$basic->features()->attach($usersFeature, ['charges' => 1]);
$pro->features()->attach($usersFeature, ['charges' => 3]);
$business->features()->attach($usersFeature, ['charges' => 10]);
$basic->features()->attach($envelopsFeature, ['charges' => 10]);
$pro->features()->attach($envelopsFeature, ['charges' => 50]);
$business->features()->attach($envelopsFeature, ['charges' => 100]);
$basic->features()->attach($trailFeature);
$pro->features()->attach($trailFeature);
$business->features()->attach($trailFeature);
$basic->features()->attach($sealFeature);
$pro->features()->attach($sealFeature);
$business->features()->attach($sealFeature);
$business->features()->attach($brandingFeature);
$business->features()->attach($smsFeature);
Hi! I tried to replicate the bug locally, but everything ran as expected. Could you send me a screenshot of the seeder in which you registered the features? ๐
Hi! I tried to replicate the bug locally, but everything ran as expected. Could you send me a screenshot of the seeder in which you registered the features? ๐
Hi @lucasdotvin it occurs if you try to consume a feature whose periodicity_type is null