lucasdotvin / laravel-soulbscription

A straightforward interface to handle subscriptions and feature consumption.
https://soulbscription.lucas.vin
MIT License
580 stars 79 forks source link

Renew functions doubles the remaining months instead of adding periodicity. #101

Open GL1TCH1337 opened 4 months ago

GL1TCH1337 commented 4 months ago

I want to have a system like if user has no subs subscribe but if he have extend it. But with this code. It goes like this. On first use it extends 1 month. After second run it extends 2 after 4 and it goes like this. Every time he extends remaining time doubles itself.

``

    $plan = \LucasDotVin\Soulbscription\Models\Plan::find(1);

    $subs = \auth()->user()->subscription;
    if(!$subs){
        \auth()->user()->subscribeTo($plan);
    }else{
       $subs->renew();
    }

``

lucasdotvin commented 4 months ago

Hey! Thanks for reporting the bug! This is a very weird behavior. 🧐 I'll make some tests and try to find the root cause for that.

stevebrainng commented 4 months ago

Hi @lucasdotvin Have you had time to check this behavior? if not I can run a quick test, and then send a pull request.