In a php laravel 9 project i try to use this library:
https://packagist.org/packages/cnlpete/image-metadata-parser
I added it to composer configuration:
composer require cnlpete/image-metadata-parser
Then I add it in controller to be able to find the class.
I tried like this :
//add this into controller:
require '../vendor/autoload.php';
use cnlpete\image-metadata-parser;
And I get error syntax error, unexpected token "-", expecting "," or ";"
Then I also added in config/app.php this:
'aliases' => [
'ImageMetadataParser' => cnlpete\image-metadata-parser\imageMetadataParser::class,
],
I see the path to the library after it was installed by composer is: myappname/vendor/cnlpete/image-metadata-parser/imageMetadataParser.php
If I use just like this without other configuration:
$imageparser = new vendor\cnlpete\image-metadata-parser\ImageMetadataParser(....);
I get error: Error Class "App\Http\Controllers\vendor\cnlpete\image" not found
How to include this library in the controller to be able to use it?