laraplans icon indicating copy to clipboard operation
laraplans copied to clipboard

$user->subscriptionUsage()->record('tempore'); fails

Open Georde opened this issue 5 years ago • 4 comments

Invalid plan feature: tempore

tempore exist in database

Don't pass in Feature.php lines: 41. if (!self::isValid($feature_code)) { 42 throw new InvalidPlanFeatureException($feature_code); 43 }

Laravel 5.6

Georde avatar Aug 06 '18 21:08 Georde

Hi Georde,

Feature codes are stored in the config file config/laraplans.php under the config key features. You can view an example here. It should work correctly once you define the features in the config file.

I think the documentation is missing the features set up; will have to check.

gerardojbaez avatar Aug 06 '18 21:08 gerardojbaez

But does not it make sense to have registered features in the config if I have dynamic features, I mean that all the features that I register in the database I have to have in this configuration file too?

Georde avatar Aug 06 '18 22:08 Georde

You must configure your site features before using them. As I have mentioned in my previous comment, all features are defined in the config/laraplans.php file. Laraplans uses this file to validate the features passed and retrieve additional configuration (if needed).

Laraplans does not support dynamic features (i.e., loading them from the database). Any feature used by the site/package must be defined first in the config file.

gerardojbaez avatar Aug 06 '18 22:08 gerardojbaez

ok thanks

Georde avatar Aug 06 '18 22:08 Georde