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

How can i get print job id after send a job? #1

Closed
thuongqbd opened this issue Jul 11, 2020 · 3 comments
Closed

How can i get print job id after send a job? #1

thuongqbd opened this issue Jul 11, 2020 · 3 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@thuongqbd
Copy link

Description

After send a job, how can i get print job id from print node?

Steps to reproduce

Printing::newPrintTask() ->printer($printerId) ->file('path_to_file.pdf') ->send();

Context

  • Laravel Printing version: 1.1.3
  • Laravel version: 7.x
@thuongqbd thuongqbd added the bug Something isn't working label Jul 11, 2020
@rawilk rawilk added question Further information is requested and removed bug Something isn't working labels Jul 11, 2020
@rawilk
Copy link
Owner

rawilk commented Jul 11, 2020

When send() is called, it returns an instance of PrintJob, which has a method id on it.

$printJob = Printing::newPrintTask()
    ->printer($printerId)
    ->file('path_to_file.pdf')
    ->send();

dd($printJob->id());

Note: This is untested and I can't guarantee that it works at this time.

@thuongqbd
Copy link
Author

I tested $printJob->id(), it return null

@rawilk
Copy link
Owner

rawilk commented Jul 14, 2020

I do receive the print job ID from PrintNode when a successful response is returned, so it should be just a matter of me setting the id property on the print job instance itself I return it. I'll just update that when I get a chance to.

@rawilk rawilk added the bug Something isn't working label Jul 15, 2020
@rawilk rawilk closed this as completed in c0150a0 Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants