Right way to publish custom classes from Laravel Package

271 Views Asked by At

Lets say I'm building a laravel package, which has hierarchy like this:

PackageContainerClass > *PackageClass* > SomePackageClassMethod()

I want to make PackageClass swappable by a class from main App.

I know I could create a publishable config/package_config.php where the user could override PackageClass location and then use it for creating PackageClass object in the package. But I have quite a few classes to be 'swapped', and dont really feel that its the right approach. What's the best approach for this, is there any Laravel magic I dont know about?

0

There are 0 best solutions below