Giter Club home page Giter Club logo

Comments (2)

geraldokandonga avatar geraldokandonga commented on June 21, 2024

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.

Omranic avatar Omranic commented on June 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.