Skip to content

CanSubscribe trait collides with Laravel Spark's Billable::subscriptions trait #118

@jayenne

Description

@jayenne

When running both laravel Spark (billing app) on the default User model, along with CanSubscribe, we get a php collision.

Trait method Multicaret\Acquaintances\Traits\CanSubscribe::subscriptions has not been applied as App\Models\User::subscriptions, because of collision with Spark\Billable::subscriptions

I was hoping to work around it using php's insteadof method but am not getting much further..

use Billable, CanSubscribe {
        Billable::subscriptions insteadof CanSubscribe; // Use Billable's subscriptions method
        CanSubscribe::subscriptions as acqSubscriptions; // Alias CanSubscribe's subscriptions method
    }

results in..

Multicaret\Acquaintances\Interaction::attachPivotsFromRelation(): Argument #1 ($morph) must be of type Illuminate\Database\Eloquent\Relations\MorphToMany, Illuminate\Database\Eloquent\Relations\HasMany given, called in /var/www/html/vendor/multicaret/laravel-acquaintances/src/Interaction.php on line 132 

$this->auth->toggleSubscribe($post);

Would you/anyone have any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions