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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5402d-45283.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5402d-45283.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?