laravelcm / laravel-subscriptions

Laravel Subscriptions is a flexible plans and subscription management system for Laravel.
MIT License
111 stars 19 forks source link

Call to undefined method Laravelcm\Subscriptions\Models\Plan::planSubscriptions() #13

Closed IsbosetA closed 3 months ago

IsbosetA commented 6 months ago

This error is in Model Plan,

protected static function boot(): void
    {
        parent::boot();

        static::deleted(function (Plan $plan): void {
            $plan->features()->delete();
            $plan->planSubscriptions()->delete();
        });
    }

For solved it you only need to change $plan->planSubscriptions()->delete(); to $plan->subscriptions()->delete(); This error ocurred when you use $plan->delete(); method

evokelektrique commented 5 months ago

I have the same issue in Laravel 10

IsbosetA commented 5 months ago

I have the same issue in Laravel 10

this is the solution

For solved it you only need to change $plan->planSubscriptions()->delete(); to $plan->subscriptions()->delete(); This error ocurred when you use $plan->delete(); method

the error ocurred for de fuction name

mckenziearts commented 3 months ago

Fix on the newest release. Thank you