Comments (6)
@yuhua-chen hi there.... try to pu hour instead of day at trial interval ... works for me
from laravel-subscriptions.
Wow! what a tricky way. I'll give a try. Thanks.
from laravel-subscriptions.
@yuhua-chen hi there.... try to pu hour instead of day at trial interval ... works for me
Hi, I think the Period class is still put the trial duration even when we set the trial_period to 0.
What do I do to overcome this problem is to create a new method in the App\User.php
also called newSubscription
with a little modification:
public function newSubscription($subscription, Plan $plan, $isTrial = TRUE)
{
$trial = new Period($plan->trial_interval, $plan->trial_period, now());
$period = new Period($plan->invoice_interval, $plan->invoice_period, $trial->getEndDate());
return $this->subscriptions()->create([
'name' => $subscription,
'plan_id' => $plan->getKey(),
'trial_ends_at' => $isTrial ? $trial->getEndDate() : now(),
'starts_at' => $period->getStartDate(),
'ends_at' => $period->getEndDate(),
]);
}
You can see the new parameter called $isTrial
you can provide to determine that the subscription is using trial period or not.
from laravel-subscriptions.
Thank you all for your patience, this is now fixed in a83c765
Now it should add skip trial period if it's set to 0
as expected.
from laravel-subscriptions.
is there a way to skip the trial period event it was set?
from laravel-subscriptions.
I'm planning to support that in an upcoming rewrite of this package, no ETA however! PRs are welcome 🙂
from laravel-subscriptions.
Related Issues (20)
- Renew Subscription and try to use record feature usage, Unique Key constraint voilation HOT 2
- Problem with surcharging models (tenancy case) HOT 1
- Problem with surcharged models (multi-tenancy architecture) HOT 2
- sort_order doesnt take the value i have given it take increment value automatically in version 4.1.0 any help ? HOT 3
- Wrong morph columns name of migrated table HOT 2
- Mutiple currencies and prices HOT 1
- whats different starts_at and trial_ends_at HOT 1
- ERROR: There are no commands defined in the "rinvex:publish" namespace HOT 1
- Get bookings of the given user with plan price HOT 2
- what are prorate_period,prorate_extend_due, prorate_extend_day for? HOT 1
- How to get user current subscription HOT 7
- Trait "Rinvex\Subscriptions\Traits\HasPlanSubscriptions" not found HOT 2
- The model PlanSubscription returns false on canUseFeature
- Problem with installation on Laravel 7 HOT 2
- Laravel doesn't read migrations and configs from published files HOT 1
- How to implement default plan on user signup? [DONE] HOT 1
- How to get list of subscriptions that are due/past due?
- HasPlanSubscriptions Error HOT 5
- Creating Plans using Seeders Failing HOT 4
- Laravel 9 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-subscriptions.