Skip to content

Commit

Permalink
just when you think you're done, a few more updates and refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jef committed Mar 14, 2020
1 parent ce60632 commit e25ca0e
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'laraplans', u'LaravelPlans Documentation',
(master_doc, 'laravelplans', u'LaravelPlans Documentation',
[author], 1)
]

Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Definitions:
- **Positive Words**: Used to tell if a particular feature is *enabled*. E.g., if the feature ``listing_title_bold`` has the value ``Y`` (*Y* is one of the positive words) then, that means it's *enabled*.
- **Features**: List of features that your app and plans use.

Take a look to the ``config/laraplans.php`` config file for more details.
Take a look to the ``config/laravelplans.php`` config file for more details.
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<env name="DB_CONNECTION" value="testing"/>
</php>
<testsuites>
<testsuite name="LaraPlans">
<testsuite name="LaravelPlans">
<directory>./tests/</directory>
</testsuite>
</testsuites>
Expand Down
2 changes: 1 addition & 1 deletion src/LaravelPlans/Events/SubscriptionCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class SubscriptionCreated
use Dispatchable, SerializesModels;

/**
* @var \Laraplans\Models\PlanSubscription
* @var \Czechbox\LaravelPlans\Models\PlanSubscription
*/
public $subscription;

Expand Down
4 changes: 2 additions & 2 deletions src/LaravelPlans/Events/SubscriptionPlanChanged.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ class SubscriptionPlanChanged
use SerializesModels;

/**
* @var \Laraplans\Models\PlanSubscription
* @var \Czechbox\LaravelPlans\Models\PlanSubscription
*/
public $subscription;

/**
* Create a new event instance.
*
* @param \Laraplans\Models\PlanSubscription $subscription
* @param \Czechbox\LaravelPlans\Models\PlanSubscription $subscription
* @return void
*/
public function __construct(PlanSubscription $subscription)
Expand Down
4 changes: 2 additions & 2 deletions src/LaravelPlans/Events/SubscriptionRenewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ class SubscriptionRenewed
use SerializesModels;

/**
* @var \Laraplans\Models\PlanSubscription
* @var \Czechbox\LaravelPlans\Models\PlanSubscription
*/
public $subscription;

/**
* Create a new event instance.
*
* @param \Laraplans\Models\PlanSubscription $subscription
* @param \Czechbox\LaravelPlans\Models\PlanSubscription $subscription
* @return void
*/
public function __construct(PlanSubscription $subscription)
Expand Down
6 changes: 3 additions & 3 deletions src/LaravelPlans/Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct($feature_code)

$this->feature_code = $feature_code;

$feature = config('laraplans.features.'.$feature_code);
$feature = config('laravelplans.features.'.$feature_code);

if (is_array($feature)) {
foreach ($feature as $key => $value) {
Expand All @@ -62,7 +62,7 @@ public function __construct($feature_code)
*/
public static function getAllFeatures()
{
$features = config('laraplans.features');
$features = config('laravelplans.features');

if (!$features) {
return [];
Expand All @@ -89,7 +89,7 @@ public static function getAllFeatures()
*/
public static function isValid($code)
{
$features = config('laraplans.features');
$features = config('laravelplans.features');

if (array_key_exists($code, $features)) {
return true;
Expand Down
16 changes: 8 additions & 8 deletions src/LaravelPlans/LaravelPlansServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ class LaravelPlansServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->loadTranslationsFrom(__DIR__.'/../lang', 'laraplans');
$this->loadTranslationsFrom(__DIR__.'/../lang', 'laravelplans');

$this->publishes([
__DIR__.'/../database/migrations/' => database_path('migrations')
], 'migrations');

$this->publishes([
__DIR__.'/../config/laraplans.php' => config_path('laraplans.php')
__DIR__ . '/../config/laravelplans.php' => config_path('laravelplans.php')
], 'config');

$this->publishes([
__DIR__.'/../lang' => resource_path('lang/vendor/laraplans'),
__DIR__.'/../lang' => resource_path('lang/vendor/laravelplans'),
]);
}

Expand All @@ -43,12 +43,12 @@ public function boot()
*/
public function register()
{
$this->mergeConfigFrom(__DIR__.'/../config/laraplans.php', 'laraplans');
$this->mergeConfigFrom(__DIR__ . '/../config/laravelplans.php', 'laravelplans');

$this->app->bind(PlanInterface::class, config('laraplans.models.plan'));
$this->app->bind(PlanFeatureInterface::class, config('laraplans.models.plan_feature'));
$this->app->bind(PlanSubscriptionInterface::class, config('laraplans.models.plan_subscription'));
$this->app->bind(PlanSubscriptionUsageInterface::class, config('laraplans.models.plan_subscription_usage'));
$this->app->bind(PlanInterface::class, config('laravelplans.models.plan'));
$this->app->bind(PlanFeatureInterface::class, config('laravelplans.models.plan_feature'));
$this->app->bind(PlanSubscriptionInterface::class, config('laravelplans.models.plan_subscription'));
$this->app->bind(PlanSubscriptionUsageInterface::class, config('laravelplans.models.plan_subscription_usage'));
$this->app->bind(SubscriptionBuilderInterface::class, SubscriptionBuilder::class);
$this->app->bind(SubscriptionResolverInterface::class, SubscriptionResolver::class);
}
Expand Down
6 changes: 3 additions & 3 deletions src/LaravelPlans/Models/Plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected static function boot()
*/
public function features()
{
return $this->hasMany(config('laraplans.models.plan_feature'));
return $this->hasMany(config('laravelplans.models.plan_feature'));
}

/**
Expand All @@ -70,7 +70,7 @@ public function features()
*/
public function subscriptions()
{
return $this->hasMany(config('laraplans.models.plan_subscription'));
return $this->hasMany(config('laravelplans.models.plan_subscription'));
}

/**
Expand All @@ -91,7 +91,7 @@ public function getIntervalNameAttribute()
*/
public function getIntervalDescriptionAttribute()
{
return trans_choice('laraplans::messages.interval_description.'.$this->interval, $this->interval_count);
return trans_choice('laravelplans::messages.interval_description.'.$this->interval, $this->interval_count);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/LaravelPlans/Models/PlanFeature.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ class PlanFeature extends Model implements PlanFeatureInterface
*/
public function usage()
{
return $this->hasMany(config('laraplans.models.plan_subscription_usage'));
return $this->hasMany(config('laravelplans.models.plan_subscription_usage'));
}
}
4 changes: 2 additions & 2 deletions src/LaravelPlans/Models/PlanSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class PlanSubscription extends Model implements PlanSubscriptionInterface
/**
* Subscription Ability Manager instance.
*
* @var Czechbox\Laraplans\SubscriptionAbility
* @var Czechbox\LaravelPlans\SubscriptionAbility
*/
protected $ability;

Expand Down Expand Up @@ -122,7 +122,7 @@ public function subscribable()
public function usage()
{
return $this->hasMany(
config('laraplans.models.plan_subscription_usage'),
config('laravelplans.models.plan_subscription_usage'),
'subscription_id'
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/LaravelPlans/Models/PlanSubscriptionUsage.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class PlanSubscriptionUsage extends Model implements PlanSubscriptionUsageInterf
*/
public function feature()
{
return $this->belongsTo(config('laraplans.models.plan_feature'));
return $this->belongsTo(config('laravelplans.models.plan_feature'));
}

/**
Expand All @@ -46,7 +46,7 @@ public function feature()
*/
public function subscription()
{
return $this->belongsTo(config('laraplans.models.plan_subscription'));
return $this->belongsTo(config('laravelplans.models.plan_subscription'));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/LaravelPlans/Period.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static function getAllIntervals()
$intervals = [];

foreach (array_keys(self::$intervalMapping) as $interval) {
$intervals[$interval] = trans('laraplans::messages.'.$interval);
$intervals[$interval] = trans('laravelplans::messages.'.$interval);
}

return $intervals;
Expand Down
2 changes: 1 addition & 1 deletion src/LaravelPlans/SubscriptionAbility.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function enabled($feature)

// If value is one of the positive words configured then the
// feature is enabled.
if (in_array(strtoupper($feature_value), config('laraplans.positive_words'))) {
if (in_array(strtoupper($feature_value), config('laravelplans.positive_words'))) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/LaravelPlans/Traits/BelongsToPlan.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trait BelongsToPlan
*/
public function plan()
{
return $this->belongsTo(config('laraplans.models.plan'));
return $this->belongsTo(config('laravelplans.models.plan'));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/LaravelPlans/Traits/PlanSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function subscription($name = 'default')
*/
public function subscriptions()
{
return $this->morphMany(config('laraplans.models.plan_subscription'), 'subscribable');
return $this->morphMany(config('laravelplans.models.plan_subscription'), 'subscribable');
}

/**
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/integration/Models/PlanSubscriptionUsageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class PlanSubscriptionUsageTest extends TestCase
*/
public function it_can_check_if_usage_has_expired()
{
Config::set('laraplans.features', [
Config::set('laravelplans.features', [
'listings_per_month' => [
'resettable_interval' => 'month',
'resettable_count' => 1
Expand Down

0 comments on commit e25ca0e

Please sign in to comment.