I have several purchasable models that have a many to many relation ship with the customer model. As such I am using a BelongsToMany relationship.
BelongsToMany::make(__('Courses'), 'courses', Course::class)
->sortable()
->searchable(),
To ensure a sepeate checkout process cannot be bypassed, I need to disable the attach action of the relationship:
How can I prevent the course from being attached to the user?
1
BelongsToMany::make(__('Courses'), 'courses', Course::class)
->sortable()
->searchable()
->disableAttaching(),
try doing this
New contributor
Joel D is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.