0

I created a simple Laravel package that I have already deployed to GitHub and Packagist successfully. It can be installed via Composer as expected.

Now...

I am creating a second package that would use the first one's functionality, but it is not showing.

In the current package, I do: use Me\Package\Models\Extra, in the controller of my second package and, I get the class is not found.

I tried using the ServiceProvider register() function, but it doesn't work.

Karl Hill
  • 12,937
  • 5
  • 58
  • 95
PHPer
  • 637
  • 4
  • 19

1 Answers1

1

Use Composer to install your first package into the second package:

Lets call the first package codiiv/first-package.

Go the project root of your second package and type this command to your terminal: composer require codiiv/first-package.

common sense
  • 3,775
  • 6
  • 22
  • 31
  • That part is done and successful. I turns out it was a typo in my class declaration #smh – PHPer Dec 04 '18 at 17:45