laravel-subscriptions icon indicating copy to clipboard operation
laravel-subscriptions copied to clipboard

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

Open IsbosetA opened this issue 9 months ago • 1 comments

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

IsbosetA avatar May 07 '24 21:05 IsbosetA

I have the same issue in Laravel 10

evokelektrique avatar May 25 '24 10:05 evokelektrique

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

IsbosetA avatar May 27 '24 15:05 IsbosetA

Fix on the newest release. Thank you

mckenziearts avatar Jul 24 '24 03:07 mckenziearts