I wonder if it is possible to make the call of a function that is in a class of another project. This is the structure of both projects:
This would be an anti-pattern use. you want all classes available, by autoloading them. If you need that class, you would want to find a way to implement it into your existing bundle, or add a new bundle containing this helper functionality embedded within so that its loaded in, then use it that way. Otherwise there is no system for this, since it is an anti-pattern.
You should create a repository on GitHub or Bitbucket and add your Project 1 to that repository. This implies:
composer
(see this for more info)Having this, you'll simply need to edit the composer.json
file on the Laravel project and add your package as a dependency. Once you execute composer update
, the Project 1 will be available on the vendor directory and you can instanciate the class by its namespace.