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

No printer on localhost #13

Closed
omaisali opened this issue Feb 24, 2021 · 8 comments
Closed

No printer on localhost #13

omaisali opened this issue Feb 24, 2021 · 8 comments

Comments

@omaisali
Copy link

omaisali commented Feb 24, 2021

I have installed the package and Printnode. Set the api but when i do

print_r(Printing::printers());

Array is empty

Any hint please? Thanks

@shubhamMazire1
Copy link

I am also getting this error
Array is empty

$printers = Printing::defaultPrinterId();
     dd($printers);

please help us. @rawilk

@JonoHall
Copy link

JonoHall commented Apr 5, 2021

+1 here.

This bit of code produces an empty list:

$printers = Printing::printers();
dd($printers);

Result:

Illuminate\Support\Collection {#1349 ▼
  #items: []
}

But I can print if I specifically select a printer, so I know the API requests are working.

@JonoHall
Copy link

JonoHall commented Apr 6, 2021

OK, worked it out.

This package is requiring an out of date printnode package which relies on "offset" in the API which is breaking on new accounts. "offset" was replaced with "after" in subsequent updates of the printnode-php package, but the required version isn't being updated.

In any case, in your composer.json replace:
"printnode/printnode-php": "^2.0@RC"

With:
"printnode/printnode-php": "master"

Obviously you might want to be a bit more strict on your version than just "master", but that's as far as my knowledge on the matter can help.

@shamsuljewel
Copy link

shamsuljewel commented May 28, 2021

@JonoHall I have tried that also, but still does not getting any printers. I am using php7.4 and 1.3 version of the package.

@rawilk
Copy link
Owner

rawilk commented Feb 10, 2022

I plan on making some updates to how the PrintNode driver works behind the scenes which will hopefully help resolve this for people that have this issue.

This was referenced Feb 10, 2022
@rawilk
Copy link
Owner

rawilk commented Feb 15, 2022

In v3.0.0 of this package, I've written my own api wrapper to interact with PrintNode, so the package no longer relies on printnode/printnode-php, and you should actually remove it from your composer dependencies when upgrading.

If there's any issues with how I handle the api requests/responses, feel free to either let me know or PR a fix for them.

@rawilk rawilk closed this as completed Feb 15, 2022
@Sakthivel2001-dev
Copy link

I am using php version 7.4 what can I do. I cannot update the package version to v3.0.0

@Oscar-PF
Copy link

I have the same problem but I'm using cups, not PrintNode. Any suggestions?. Thanks in advance

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

7 participants