Support the ongoing development of Laravel.io →
Laravel Architecture
Last updated 2 years ago.
0

If the dependency is laravel compatible and you have added the service provider the dependency in the providers' array then you can easily access the models by using their namespace.

Here is what I would suggest. Create a model for your app and extend that model from the model in the dependency that way if the dependency is updated you won't have to worry about it and you can attach your methods the extended model.

0

Still can not make it work. I would like to have the models in a separate project in a Lib so I can use it in other projects, but I have not found how to map the classes in Laravel to reconnect the models as BD entities. I created the lib using Eloquent as depedence, but I'm having difficulty configuring for the Laravel application to recognize it as depedence.

0

Will be happy to help if you post some details. Like what package you are using and the way you have extended your model.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.