mercredi 21 février 2018

Laravel adding normal PHP package

I have a new Laravel 5.6 application. I wanted to see if I could an existing library (see link). The idea is that I could use the controller to parse the fit file and display the data in a view.

I have added the package adriangibbons/php-fit-file-analysis in my composer.json file.

Then the documentation mentions:

<?php
    require __DIR__ . '/vendor/autoload.php';  // this file is in the project's root folder
    $pFFA = new adriangibbons\phpFITFileAnalysis('fit_files/my_fit_file.fit');
?>

How can this be done in Laravel. Normally I would add something in the 'providers' section of my app.cfg but don't know how I can add the above snippet in there.

Any ideas?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire