The models defined in config/soulbscription.php are not compatible with HasSubscriptions trait
mezbilisim opened this issue · 1 comments
mezbilisim commented
When I define a new model for the plan in config/soulbscription.php, I cannot use some properties because these relationships are not defined in HasSubscriptions trait. For example, I can list the plans like this:
config('soulbscription.models.plan')::all();
But I can't change a plan that I have listed in this way.
$new_plan = config('soulbscription.models.plan')::find($plan_id);
$user->switchTo($new_plan);
Because dynamic relationship is not used in HasSubscriptions trait.
<?php
namespace LucasDotVin\Soulbscription\Models\Concerns;
use LucasDotVin\Soulbscription\Models\Plan;
.
.
.
trait HasSubscriptions
{
.
.
.
public function subscribeTo(Plan $plan, $expiration = null, $startDate = null): Subscription
{
.
.
.
}
}
I want to customise the plan table. I can add price, description, currency or different discriminator fields. I can associate this model with my invoices. I want to make many more customisations like this.
bestiony commented
using your own models in its config file renders this package useless. better keep using the original models especially the Feature model