I have one core php library.
I want to know detailed configuration to integrate thirdparty library into laravel. Please explain with example. like adding library and using it in controller of laravel.
Look I am using free version of phpdocx.com library. But on this library support page said that phpdocx.com doesnt provide integration option for their core php library with laravel. as they havent created a library for laravel support. so user can integrate it in composer.json and run composer install or update to get install that library.
I have got answer on third party library forum. I am updating here so it will also help to include other libraries too.
1) Extract the package to the vendor/phpdocx
folder
2) Add this line in the autoload option of your composer.json:
"files": [
"vendor/phpdocx/Classes/Create/CreateDocx.inc"
]
3) Update the composer autoloader:
php composer.phar dump-autoload
4) You can use the library:
$docx = new \Phpdocx\Create\CreateDocx();
$docx->addText('This is a test');
$docx->createDocx('Sample');