laravelcm / laravel-subscriptions

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

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

Closed IsbosetA closed 4 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 6 months ago

I have the same issue in Laravel 10

IsbosetA commented 6 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 4 months ago

Fix on the newest release. Thank you