Skip to content

Commit

Permalink
Fix typo in translation
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardojbaez committed Nov 12, 2016
1 parent 2cdc814 commit 44f3cc4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
13 changes: 6 additions & 7 deletions src/LaraPlans/SubscriptionAbility.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,12 @@ public function enabled($feature)
*/
public function value($feature, $default = null)
{
$feature = $this->subscription->plan->features->first(function ($key, $value) use ($feature) {
return $key->code === $feature;
});

if (is_null($feature))
return $default;
foreach ($this->subscription->plan->features as $key => $value) {
if ($feature === $value->code) {
return $value->value;
}
}

return $feature->value;
return $default;
}
}
11 changes: 7 additions & 4 deletions src/LaraPlans/Traits/PlanSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ trait PlanSubscriber
*/
public function subscription($name = 'default')
{
return $this->subscriptions->sortByDesc(function ($value) {
$subscriptions = $this->subscriptions->sortByDesc(function ($value) {
return $value->created_at->getTimestamp();
})
->first(function ($key, $value) use ($name) {
return $key->name === $name;
});

foreach ($subscriptions as $key => $subscription) {
if ($subscription->name === $name) {
return $subscription;
}
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lang/en/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
'day' => 'Daily|Every :count Days',
'week' => 'Weekly|Every :count Weeks',
'month' => 'Monthly|Every :count Months',
'year' => 'Anual|Every :count Years',
'year' => 'Annual|Every :count Years',
],
];

0 comments on commit 44f3cc4

Please sign in to comment.