Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eloquent-like syntax to filter records in Xero API request #39

Open
DLO33 opened this issue Dec 17, 2020 · 1 comment
Open

Eloquent-like syntax to filter records in Xero API request #39

DLO33 opened this issue Dec 17, 2020 · 1 comment

Comments

@DLO33
Copy link

DLO33 commented Dec 17, 2020

When filtering quotes (and other data), what is the syntax as it does work as per the contacts example?

For example:
$invoices = $xero->invoices()->where('InvoiceNumber', 9871)->get();

Renders the following:
/api.xro/2.0/Invoices?where=InvoiceNumber%3D%3D9871

Ultimately this should be:
/api.xro/2.0/Invoices?InvoiceNumber=9871

@DLO33
Copy link
Author

DLO33 commented Dec 18, 2020

I've been able to get this to work, but it does look like a 'hack'. Is there a better way?

$xero->invoices()->find('?InvoiceNumber=' . $request->get('InvoiceNumber'));

This renders the following url:
/api.xro/2.0/Invoices/?InvoiceNumber=9871

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant