Laravel Package development, how to deal with the many-to-many relationship between Model in a package and Model outside a package

laravel Package development, how to deal with the many-to-many relationship between Model in a package and Model outside the package?

for example:
for example, we are going to write an awesome Article Package,. This package mainly provides functions related to managing articles.
if someone else wants to write a blog site and use the Article function, you can use our package directly.

but in some projects that use our Article package, we want Article to establish a many-to-many relationship with the User in the project. How do we define many-to-many relationships under Package"s Article?
for Article, this Pakcage,User, this Model may not exist.

Feb.27,2021

if you are not sure whether it will exist, you can only create a new class in the project to inherit the class of the Article package, and then define the association relationship.

at this time, we should make use of the features of inheritance and polymorphism.

Menu