4

I'm trying to integrate the Quickbooks Online API into Laravel 5. I've got the code working outside of Laravel using the Consolibyte package. But its written in what I'll call a classic PHP style - meaning there are a number of REQUIRE_ONCE files etc. I'm sure I can crank through and integrate it all, but in the interest of saving time, I'm wondering if anyone else knows of a package for Laravel 5 which already does this?

Ultimately I need to be able to create Customers, Vendors and Invoices. Don't really need the rest of the functionality that the Consolibyte package uses (which is a great package by the way).

Joel Leger
  • 349
  • 4
  • 11

3 Answers3

3

If you're using this code:

You only need to require one file. There's no real work required to get this working in Laravel. Just do this in your Laravel app:

require_once './QuickBooks.php';

And you're done.

Keith Palmer Jr.
  • 27,666
  • 16
  • 68
  • 105
  • Which config file is used when doing it this way. I can see that Quickbooks.php is included in the autoloaded files when installing via composer but which config.php file would I use to add my keys etc. – Steven1978 Nov 18 '15 at 10:17
  • The package isn't a native Laravel package/plugin, so it doesn't use any config files from Laravel by default. If you want it to use a config file, you need to tell Laravel to do that - it's totally unrelated to the QuickBooks lib. – Keith Palmer Jr. Nov 18 '15 at 12:29
  • I have pulled this code into my app using composer but I'm a bit stuck with some of the examples as I can't find the ServiceContext class within this code. DO you have any idea where it is? – Steven1978 Nov 20 '15 at 10:37
  • @Steven1978 There is no "ServiceContext" class. Are you trying to do QuickBooks Online, or QuickBooks for Windows? – Keith Palmer Jr. Nov 20 '15 at 11:43
  • Hi Keith. I am using Quickbooks online. I have got it working now using this code. I just need to Laravelify it now. Thanks for your help. Everywhere I end up on the web I see you commenting. It's great that you are so active helping people. – Steven1978 Nov 20 '15 at 14:12
  • @Steven1978 Awesome, glad you got it working! I was going to build out an example for you and check it into GitHub. If you can share any of the code you used, it'd be cool to take it and throw it up on GitHub with the rest of our example code. If you want to shoot me an email with anything you can share it'd be much appreciated! – Keith Palmer Jr. Nov 20 '15 at 14:35
  • I will do that Keith. It will probably be next week some time. Over the next couple of weeks I will be looking at making this work within Laravel 5 and potentially also laravel 3. Hopefully I can create service providers that can be of use for anyone. – Steven1978 Nov 20 '15 at 15:07
3

For anyone else looking to solve this problem, this obscure blog post will save your life. It's a lot to post here, but he essentially uses the consolibyte/quickbooks-php, but wraps it up in creamy Laravel goodness so you can see the "under the hood" objects you need to set up so that you don't break the framework.

I followed the instructions, with some alterations for my app, and it authorized first try (Laravel 5.2).

It's not perfect, but it's as clean as you can get for Laravel right now.

Major props to both the article writer Pawan and the package author Keith Palmer Jr!

Captain Hypertext
  • 2,446
  • 4
  • 27
  • 36
1

You can use this one instead its fully enabled to be installed by composer in Laravel or Yii2. I installed it in Yii2. https://github.com/beanworks/quickbooks-online-v3-sdk install quickbooks from this url and then use the below url to implement oauth https://github.com/IntuitDeveloper/oauth-php

You can easily make routes for oauth steps involved and there are samples in the later repo which can be used to learn how to post and query objects from quickbook.

Imran Khan
  • 358
  • 3
  • 16