lundi 19 avril 2021

How to call program classes of one project in another project

I have a project which is divided in two different larvel project. I wanted to use the programs classes of one larvel project to another and vice versa. What is the best approch to do this ? {for simplicity our project = application-a +application-b & we wanted to make call to programs of application-a from application-b and vice versa.)

The folder structure looks like

www/
├─ application-a/
│  └─ composer.json
   └─ custom-classes/
       └─ MyClassA.php
│
├─ application-b/
│  └─ composer.json
   └─ custom-classes/
          └─ MyClassB.php

Trying to call MyClassA.php from application-b/ & MyClassB.php from application-a/(Both have similar folder naming convention and namespaces). Im trying to use psr-4 but the problem is both the projects have same namespaces prefix, So how to use psr-4 in that case. Or any other beter solution.

Thanks in advance !



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire