How could I use another class in my vendor packages?
I want to implements "Searchable" & "Viewable" and add my Seo morphOne relation to a package like RinvexCategorizable, how can I do this without adding codes in to this package {from outside of vendor package}??
2
Answers
You can try to extend class from package that you need and add relation there.
Like that:
And use
AppModelsCategory
in you other code.You can create a model in your app and extends the package(vendor) model. Then define anything you want, add new traits or you can override methods.
You can use your model instead of the one provided by the package.
for example:
Note that the above code is just for a demonstration to give you hint. I hope you find it helpful.