davidtsadler / ebay-sdk-php

An eBay SDK for PHP. Use the eBay API in your PHP projects.
Apache License 2.0
349 stars 341 forks source link

Laravel Support #55

Closed mpixelz closed 7 years ago

mpixelz commented 7 years ago

Hi, Im looking to use this into my laravel project.. but cant get it to work.. while we run the composer install, it is suppose to add the autoload function automatically but i guess that is not happening as im not able to use it.

may be if anyone else here is using this on laravel can point out the installation process? or any other pointer?

assuming we would need to publish the files first? and then publish configuration files? not really sure. would really appreciate any kind of help with this. thanks. cheers.

and yeah happy holidays everyone! 😄

michabbb commented 7 years ago

@mpixelz usually it´s not a problem to add any package via composer when using laravel, because every external package in laravel is installed as usual via composer. and yes, autoloader is used in laravel, but you should check vendor/composer/autoload_classmap.php if the php-sdk-classes are included here. if not, you can add them manually with classmap but that shouldn´t be necessary. first check your autoload files if composer was able to find the sdk files and classes.....

and sorry, i don´t understand this:

assuming we would need to publish the files first? and then publish configuration files? not really sure.

mis4s commented 7 years ago

Hi,

This library works without problem laravel, you have a problem with Composer. Can you show your composer.json and what returns command php composer.phar update oraz php composer.phar require "dts/ebay-sdk-php"

mpixelz commented 7 years ago

@michabbb usually when we add a package to laravel.. they ask to add service provider class as well as facade on config\app.php but there was nothing like that on this library so i thought it might be missing this for it to work with laravel.

@Viperoo i did do composer require dts/ebay-sdk-php to install this library but when i try to run a sample getebayofficaltime function, it never finds the class and the process ends up.. Did you add any serviceprovider?

p.s. im just starting a new laravel project to see if it works on a fresh install.. will get back in few mins with results. :fingercrossed:

mpixelz commented 7 years ago

just did a fresh install and it kind of worked by giving hard code paths to the services. but in the $response i did get the official time with the 'ack status as failure'. will keep digging and will update as soon as its sorted. thanks alot thou :) much appreciated.

michabbb commented 7 years ago

@mpixelz you don´t need any serviceproviders, you can use them later, if everything is working, but for simple testing, a provider is not necessary. i would suggest that you create a new artisan command for your test, just a simple cli call and copy paste the example into your new command.... about the time: keep in mind that laravel has a /config/app.php with a timezone key ;)

mpixelz commented 7 years ago

it worked thanks alot guys :)