Comments (2)
I had a similar issue and it took me some time to find a solution
for example if you added a feature like so:
$plan->features()->saveMany([ new PlanFeature(['name' => 'pictures_per_listing', 'value' => 10, 'sort_order' => 5]), ]);
when you call this feature like $model->subscription('main')->canUseFeature('pictures_per_listing');
where main is the Subscription name you can call it anything like free, pro or enterprise however this will give an error because the canUseFeature()
uses the slug field to fetch the feature
To avoid getting this error change all your calls to:
$model->subscription('main)->canUseFeature(toSLug('pictures-per-listing-main)
also when saving features that share the same naming on multiple plans, you should prefix them with the plan name like pictures_per_listing_free
if you are using multiple plans don't forget to prefix feature name with the plan name
I hope this help someone in the future
from laravel-subscriptions.
This seems to me related to #76, so I'll close and keep the discussion there. Feel free to re-open & explain if it's not.
from laravel-subscriptions.
Related Issues (20)
- 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.