Laravel 5.4 - How to use EDI Vendor Library

1.2k views Asked by At

I have installed EDI Library through composer command.

Library Link. https://github.com/php-edifact/edifact

But in this, they did not give how to register your library in App file.

So can please help me how to register it. They are giving examples of how to use this. I am just writing simple code.

   $x = [1,5,8,9];
   $c = new Parser($x);

But the above code is giving an error.

Class 'Parser' not found

2

There are 2 answers

0
Jerodev On

Try using new EDI\Parser($x). You need to tell php in what namespace to find the class you are looking for.

0
Udhav Sarvaiya On

Run this command in your command prompt

composer require sabas/edifact 

Use in the top of the file like:

namespace EDITest;
use EDI\Parser;