Fix styling
This commit is contained in:
committed by
github-actions[bot]
parent
41fb6a1fc9
commit
d86274cc37
@@ -3,7 +3,6 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class Subscription extends Model
|
||||
{
|
||||
@@ -13,6 +12,7 @@ class Subscription extends Model
|
||||
{
|
||||
return $this->belongsTo(Team::class);
|
||||
}
|
||||
|
||||
public function type()
|
||||
{
|
||||
if (isLemon()) {
|
||||
@@ -30,20 +30,20 @@ class Subscription extends Model
|
||||
if (in_array($subscription, $ultimate)) {
|
||||
return 'ultimate';
|
||||
}
|
||||
} else if (isStripe()) {
|
||||
if (!$this->stripe_plan_id) {
|
||||
} elseif (isStripe()) {
|
||||
if (! $this->stripe_plan_id) {
|
||||
return 'zero';
|
||||
}
|
||||
$subscription = Subscription::where('id', $this->id)->first();
|
||||
if (!$subscription) {
|
||||
if (! $subscription) {
|
||||
return null;
|
||||
}
|
||||
$subscriptionPlanId = data_get($subscription, 'stripe_plan_id');
|
||||
if (!$subscriptionPlanId) {
|
||||
if (! $subscriptionPlanId) {
|
||||
return null;
|
||||
}
|
||||
$subscriptionInvoicePaid = data_get($subscription, 'stripe_invoice_paid');
|
||||
if (!$subscriptionInvoicePaid) {
|
||||
if (! $subscriptionInvoicePaid) {
|
||||
return null;
|
||||
}
|
||||
$subscriptionConfigs = collect(config('subscription'));
|
||||
@@ -51,12 +51,13 @@ class Subscription extends Model
|
||||
$subscriptionConfigs->map(function ($value, $key) use ($subscriptionPlanId, &$stripePlanId) {
|
||||
if ($value === $subscriptionPlanId) {
|
||||
$stripePlanId = $key;
|
||||
};
|
||||
}
|
||||
})->first();
|
||||
if ($stripePlanId) {
|
||||
return str($stripePlanId)->after('stripe_price_id_')->before('_')->lower();
|
||||
}
|
||||
}
|
||||
|
||||
return 'zero';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user